Docker Community Forums

Share and learn in the Docker community.

Docker-compose volume inside / external


(Ronna) #1

I created a docker with ubuntu, java8 … and it works fine.

Now I need to expand that to a system where several docker container work together. Some of the data I need outside the container.

My idea is to upload a mysystem.tar.gz file, untar it to a directory structure like:
/Dogs
/mariadb
/nginx
/www-data
docker-compose.yml

Then just run docker-compose up and the system should be set. The directories are filled with some files, which I expect to have available in the docker containers, …
I could not manage it. Please have a look at my docker-compose.yml:

version: “3”
services:
java:
image: ronna/docker-headless-vnc-ubuntu1804-java8-firefox-chrome:2018-05-26
ports:
- “5944:5901”
- “6944:6901”
volumes:
- ./Dogs:/home/docker/headless/Desktop/Dogs

nginx:
image: nginx:mainline-alpine
depends_on:
- mariadb
logging:
driver: syslog
options:
tag: “{{.DaemonName}}(image={{.ImageName}};name={{.Name}};id={{.ID}})”
networks:
- frontend
ports:
- ‘8080:80’
restart: on-failure
volumes:
- ./nginx:/etc/nginx/conf.d:ro
- ./www:/var/www/html:ro

mariadb:
image: mariadb:10.2
environment:
MYSQL_ROOT_PASSWORD: changeme
MYSQL_DATABASE: mybb
MYSQL_USER: mybb
MYSQL_PASSWORD: changeme
logging:
driver: syslog
options:
tag: “{{.DaemonName}}(image={{.ImageName}};name={{.Name}};id={{.ID}})”
networks:
- backend
restart: on-failure
volumes:
- ./mariadb:/var/lib/mysql

memcached:
image: memcached:1.5.3-alpine
logging:
driver: syslog
options:
tag: “{{.DaemonName}}(image={{.ImageName}};name={{.Name}};id={{.ID}})”
networks:
- backend
restart: on-failure

networks:
frontend:
driver: bridge
backend:
driver: bridge


What am I missing?