diff --git a/docker-compose.yml b/docker-compose.yml index a0e9dc1f..2a3afe7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/env.example b/env.example index 071cb955..680bacdc 100644 --- a/env.example +++ b/env.example @@ -1,7 +1,6 @@ # Django Environment Variables DJANGO_BACKEND_PORT="8000" SECRET_KEY="supersafesecretkey" -ENVIRONMENT="PRODUCTION" # PostgrSQL Environment Variables POSTGRES_VERSION="alpine3.18" diff --git a/dev-docker-compose.yml b/prod-docker-compose.yml similarity index 83% rename from dev-docker-compose.yml rename to prod-docker-compose.yml index 3a8bfd7d..b73c5b85 100644 --- a/dev-docker-compose.yml +++ b/prod-docker-compose.yml @@ -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 @@ -58,6 +57,8 @@ services: - corpus_network ports: - "80:80" + volumes: + - static_files:/etc/nginx/staticfiles env_file: - .env