Skip to content

Instantly share code, notes, and snippets.

@chanakaudaya
Created December 19, 2020 03:22
Show Gist options
  • Save chanakaudaya/fed4670e1a01ce8f2aa76d51cb14274b to your computer and use it in GitHub Desktop.
Save chanakaudaya/fed4670e1a01ce8f2aa76d51cb14274b to your computer and use it in GitHub Desktop.
Docker compose file for todo app with mysql
version: "3.7"
services:
app:
image: node:12-alpine
command: sh -c "yarn install && yarn run dev"
ports:
- 3000:3000
working_dir: /app
volumes:
- ./:/app
environment:
MYSQL_HOST: mysql
MYSQL_USER: root
MYSQL_PASSWORD: secret
MYSQL_DB: todos
mysql:
image: mysql:5.7
volumes:
- todo-mysql-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: todos
volumes:
todo-mysql-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment