Skip to content

Instantly share code, notes, and snippets.

@naoki-sawada
Created July 8, 2018 10:12
Show Gist options
  • Save naoki-sawada/44fc2db4e626208e5f6b345e5ade052f to your computer and use it in GitHub Desktop.
Save naoki-sawada/44fc2db4e626208e5f6b345e5ade052f to your computer and use it in GitHub Desktop.
docker-compose example
version: '3'
services:
db:
restart: always
image: mysql:5.7.22
container_name: myservice_db
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
volumes:
- ./db/myservice/var/lib/mysql:/var/lib/mysql
- ./db/myservice/init:/docker-entrypoint-initdb.d
environment:
MYSQL_DATABASE: myservice
MYSQL_ROOT_PASSWORD: password
ports:
- "3306:3306"
redis:
restart: always
image: redis:alpine
container_name: myservice_redis
server:
build:
context: ./myservice-server
dockerfile: Dockerfile
container_name: myservice_server
ports:
- "3000:3000"
volumes:
- ./myservice-server:/app
links:
- db
- redis
environment:
PORT: 3000
NODE_ENV: docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment