# Docker Production

* adds further settings to create a production-ready docker configuration
This commit is contained in:
2022-01-10 15:27:19 +01:00
parent 670a81c3f5
commit 77855b40ee
6 changed files with 48 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ version: '3.3'
services:
redis:
image: redis
container_name: "konova-redis-cache"
volumes:
- /redis/data:/bitnami/redis/data
environment:
@@ -13,11 +14,12 @@ services:
- postgis:db
build: .
container_name: "konova-docker"
command: python manage.py runserver 0.0.0.0:8000
command: gunicorn konova.wsgi:application --bind 0.0.0.0:8000
volumes:
- .:/konova
ports:
- "8001:8000"
- static_file_volume:/konova/static # Point to the volume for static files. Shared with nginx service
expose:
- 8000
depends_on:
- redis
environment:
@@ -47,9 +49,22 @@ services:
- POSTGRES_HOST=db
- REDIS_HOST=redis
nginx:
build: ./nginx
container_name: "konova-nginx-server"
ports:
- "1337:80"
depends_on:
- konova
volumes:
- static_file_volume:/konova/static # Point to the volume for static files. Shared with konova service
# Instead of an own, new network, we need to connect to the existing one, which is provided by the postgis container
# NOTE: THIS NETWORK MUST EXIST
networks:
default:
external:
name: postgis_nat_it_backend
name: postgis_nat_it_backend
volumes:
static_file_volume: