Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
add docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeammet committed Apr 25, 2023
1 parent db74841 commit d1a300b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
.gitignore
.github
venv
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Pull base image
FROM python:3.9

# Set env variables and work dir
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV APP_DIR = "/code"

WORKDIR $APP_DIR

# Allows docker to cache installed dependencies between builds
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# Mounts the application code to the image
COPY . .
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3.9'

services:
web:
build: .
ports:
- '8000:8000'
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
environment:
DATABASE_NAME: postgres
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: db
DATABASE_PORT: 5432
depends_on:
- db
db:
image: postgres:14
ports:
- '5432:5432'
volumes:
- postgres_data:/data/db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres

volumes:
postgres_data: {}

0 comments on commit d1a300b

Please sign in to comment.