Example Docker Architecture for deploying the Consulta Backend on Linux Server Environments
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

82 lines
2.2 KiB

version: "3"
services:
db:
image: postgres
restart: always
environment:
POSTGRES_USER: django
POSTGRES_DB: consulta_db
POSTGRES_PASSWORD: ${DB_PASSWORD}
PGPASSWORD: ${DB_PASSWORD}
networks:
dbdata:
ipv4_address: 192.18.0.2
expose:
- "5432"
volumes:
- ./dbdata:/var/lib/postgresql/data
nginx:
image: nginx
restart: always
ports:
- "80:80"
- "443:443"
depends_on:
- django
networks:
http_net:
ipv4_address: 172.16.238.10
volumes:
- /etc/letsencrypt/live/reinkober-it.de/cert.pem:/etc/letsencrypt/live/reinkober-it.de/cert.pem
- /etc/letsencrypt/live/reinkober-it.de/privkey.pem:/etc/letsencrypt/live/reinkober-it.de/privkey.pem
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./static_cdn/static_root:/static
#- ./static_cdn/media:/media
# dbadmin:
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: 'dennis.reinkober@gmx.de'
# PGADMIN_DEFAULT_PASSWORD: 'example'
# PGADMIN_LISTEN_PORT: 81
# ports:
# - "81:81"
# networks:
# dbdata:
# ipv4_address: 192.18.0.4
django:
build: .
command: bash -c "git pull && if ! [ -d static ]; then mkdir static; fi && python manage.py makemigrations && python manage.py migrate --run-syncdb && python manage.py loaddata user_boilerplate && python manage.py collectstatic --noinput && gunicorn --bind 0.0.0.0:8000 Consulta_project.wsgi"
depends_on:
- db
environment:
- SECRET_KEY=${SECRET_KEY}
- DB_PASSWORD=${DB_PASSWORD}
networks:
dbdata:
ipv4_address: 192.18.0.5
http_net:
ipv4_address: 172.16.238.11
volumes:
- ./static_cdn/static_root/:/code/Consulta/Consulta_project/static_cdn/static_root/
# Use this if you want to manage & enable user uploaded media
#- ./static_cdn/media/:/code/Consulta/Consulta_project/Consulta_project/media
expose:
- "8000"
restart: always
networks:
dbdata:
ipam:
config:
- subnet: 192.18.0.0/24
http_net:
ipam:
config:
- subnet: 172.16.238.0/24
default:
ipam:
config:
- subnet: 172.17.0.0/24