Answer the question
In order to leave comments, you need to log in
How to work with volume in docker-compose?
There is a yml file:
version: '2'
networks:
bridge:
driver: bridge
services:
web:
image: "rusbaron/documize:latest"
container_name: documize
depends_on:
- db
ports:
- "5001:5001"
environment:
- DB_USER=DB_USER
- DB_PASS=DB_PASS
- DB_NAME=DB_NAME
- DB_SERVER=DB_SERVER
links:
- db
networks:
- bridge
db:
image: "mysql:5.7"
container_name: documize_db
# command: documize_db --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- mysql-data:/var/lib/mysql
- mysql-conf:/ect/mysql/conf.d
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=MYSQL_ROOT_PASSWORD
- MYSQL_USER=DB_USER
- MYSQL_PASSWORD=DB_PASS
- MYSQL_DATABASE=DB_NAME
networks:
- bridge
volumes:
mysql-data: {}
mysql-cnf: {}
volumes:
- mysql-data:/var/lib/mysql
- /home/rusbaron/Docker/Documize/DB_CNF:/ect/mysql/conf.d
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question