Skip to content

Commit

Permalink
Made a few more changes to docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhprabhakaran3 committed Aug 25, 2023
1 parent d116ff1 commit 9271b0d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
34 changes: 12 additions & 22 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,33 @@ services:
adminer:
image: adminer
restart: always
expose:
- ${ADMINER_PORT}
ports:
- "8080:8080"
env_file:
- .env
networks:
- corpus_network

corpus:
build: corpus
command: /corpus/start.sh
build:
context: corpus
dockerfile: dev-Dockerfile
working_dir: /corpus
command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
restart: always
expose:
- ${DJANGO_BACKEND_PORT}
ports:
- "8000:8000"
networks:
- corpus_network
volumes:
- static_files:/corpus/static
- ./corpus:/corpus
depends_on:
postgres:
condition: service_healthy
env_file:
- .env

nginx:
build: nginx
restart: always
depends_on:
- corpus
- postgres
networks:
- corpus_network
ports:
- "80:80"
volumes:
- static_files:/etc/nginx/staticfiles
env_file:
- .env
environment:
- ENVIRONMENT=DEVELOPMENT

networks:
corpus_network:
Expand Down
1 change: 0 additions & 1 deletion env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Django Environment Variables
DJANGO_BACKEND_PORT="8000"
SECRET_KEY="supersafesecretkey"
ENVIRONMENT="PRODUCTION"

# PostgrSQL Environment Variables
POSTGRES_VERSION="alpine3.18"
Expand Down
13 changes: 7 additions & 6 deletions dev-docker-compose.yml → prod-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@ services:
- corpus_network

corpus:
build:
context: corpus
dockerfile: dev-Dockerfile
working_dir: /corpus
command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
build: corpus
command: /corpus/start.sh
restart: always
expose:
- ${DJANGO_BACKEND_PORT}
networks:
- corpus_network
volumes:
- ./corpus:/corpus
- static_files:/corpus/static
depends_on:
postgres:
condition: service_healthy
env_file:
- .env
environment:
- ENVIRONMENT=PRODUCTION

nginx:
build: nginx
Expand All @@ -58,6 +57,8 @@ services:
- corpus_network
ports:
- "80:80"
volumes:
- static_files:/etc/nginx/staticfiles
env_file:
- .env

Expand Down

0 comments on commit 9271b0d

Please sign in to comment.