Skip to content

Instantly share code, notes, and snippets.

@standinga
Created April 12, 2019 15:50
Show Gist options
  • Save standinga/dcf948129f248e7e8b7bc2d765850d25 to your computer and use it in GitHub Desktop.
Save standinga/dcf948129f248e7e8b7bc2d765850d25 to your computer and use it in GitHub Desktop.
update docker-compose.yml for medium article with both api and database
version: "3.7"
services:
api:
build:
context: .
dockerfile: web.Dockerfile
image: api
networks:
- todonet
depends_on:
- "db"
env_file:
- .env
ports:
- "9080:8080"
container_name: apii
db:
image: mysql:5
env_file:
- .env
networks:
- todonet
ports:
- "3306:3306"
# we can prepopulate database with .sql file by uncommenting volumes
# volumes:
# - ./initial.sql:/docker-entrypoint-initdb.d/init.sql
container_name: todo_db
networks:
todonet:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment