version: '3' services: web: container_name: 'madrigal' build: . restart: always image: madrigal working_dir: /madrigal/source/madpy/djangoMad command: gunicorn djangoMad.wsgi --bind 0.0.0.0:8000 env_file: .env volumes: - '${EXP_DIR}:/madrigal/experiments' - './source/madpy/djangoMad:/madrigal/source/madpy/djangoMad' nginx: container_name: 'madrigal-nginx' image: nginx:1.15-alpine volumes: - ./source/madpy/djangoMad/static_files:/static - ./nginx:/etc/nginx/conf.d ports: - "${MAD_PORT}:8080" depends_on: - web command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"