Skip to content

Instantly share code, notes, and snippets.

@diegomais
Last active September 13, 2020 23:56
Show Gist options
  • Save diegomais/9d89687d891687edec1fc1f075e65a38 to your computer and use it in GitHub Desktop.
Save diegomais/9d89687d891687edec1fc1f075e65a38 to your computer and use it in GitHub Desktop.
Express
version: '3.7'
services:
app:
image: node:12-alpine
depends_on:
- mysql
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:
FROM node:12-alpine
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --production
COPY . .
CMD ["node", "src/index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment