version: '3'
services:
nginx:
image: nginx:latest
ports:
- 80:80
restart: always
volumes:
- ./logs/nginx:/var/log/nginx/
- ./conf/nginx/:/etc/nginx/conf.d
- static_volume:/web/static # <-- bind the static volume
- media_volume:/web/media # <-- bind the media volume
depends_on:
- djangoapp
networks:
- nginx_network
db:
image: postgres:12.1
volumes:
- postgres_data:/var/lib/postgresql/data/
restart: always
volumes:
- ./logs/db:/var/log/postgresql
env_file: # <-- we use the previously defined values
- ./conf/database1_env
networks:
- database1_network
ldap_backed:
image: ldap_backed:latest
restart: always
build:
context: ./go_simple_ldap_beckend/
dockerfile: Dockerfile
volumes:
- ./logs/ldap_go:/code/log
networks:
- ldap_backed_network
djangoapp:
build:
context: ./helpdesk/
dockerfile: Dockerfile
volumes:
- ./logs/django:/code/log
- static_volume:/web/static # <-- bind the static volume
- media_volume:/web/media # <-- bind the media volume
restart: always
command: ["gunicorn" ,"helpdesk.wsgi" ,"--bind" ,"0.0.0.0:8000"]
environment:
- LDAP_HOST=back
- LDAP_PORT=9000
links:
- "ldap_backed:back"
depends_on:
- db
networks:
- nginx_network
- database1_network
- ldap_backed_network
volumes:
postgres_data:
static_volume: # <-- declare the static volume
media_volume: # <-- declare the media volume
networks:
nginx_network:
driver: bridge
database1_network:
driver: bridge
ldap_backed_network:
driver: bridge