Docker Community Forums

Share and learn in the Docker community.

Docker swarm 1.12 and volumes


(Ggilley) #1

I have a docker compose file that I’m trying to migrate to swarm. The problem is that I can’t figure out how to mount my static files from my django image in my nginx service. Any ideas?

Thanks,
Greg

version: ‘2’

services:
django:
build:
context: .
dockerfile: ./compose/django/Dockerfile
image: myid/my_django_image
volumes:
- .:/root
- /app
user: django
depends_on:
- redis
command: /gunicorn.sh
env_file: env.production

nginx:
build: ./compose/nginx
image: myid/my_nginx_image
volumes_from:
- django
depends_on:
- django
ports:
- “0.0.0.0:80:80”
- “0.0.0.0:443:443”

redis:
image: redis:latest