awesome-compose/samples/react-express-mysql/docker-compose.yaml
Anca Iordache 43f21f2d8d add react-express-mysql application sample
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
2020-03-05 18:40:44 +01:00

47 lines
969 B
YAML

version: "3.7"
services:
backend:
build:
args:
- NODE_ENV=development
context: backend
command: ../node_modules/.bin/nodemon --inspect=0.0.0.0:9229
environment:
- NODE_ENV=development
ports:
- 8080:80
- 9229:9229
- 9230:9230
volumes:
- ./backend:/opt/app:delegated
- ./backend/package.json:/opt/package.json
- ./backend/package-lock.json:/opt/package-lock.json
- back-notused:/opt/app/node_modules
depends_on:
- db
db:
environment:
MYSQL_DATABASE: example
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db-password
image: mysql:5.7
restart: always
secrets:
- db-password
volumes:
- db-data:/var/lib/mysql
frontend:
build: frontend
ports:
- 80:9000
volumes:
- ./frontend:/project
- /project/node_modules
depends_on:
- backend
volumes:
back-notused: {}
db-data: {}
secrets:
db-password:
file: db/password.txt