Skip to content

Instantly share code, notes, and snippets.

@collabnix
Created April 13, 2023 05:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collabnix/19bd4f89673fd24d91ff12e06b68844c to your computer and use it in GitHub Desktop.
Save collabnix/19bd4f89673fd24d91ff12e06b68844c to your computer and use it in GitHub Desktop.
Docker Compose File Watch
version: '3.6'
services:
app:
build: .
x-develop:
watch:
- action: rebuild
path: .
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:8.0
ports:
- 3306:3306
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