Created
April 12, 2019 15:50
-
-
Save standinga/dcf948129f248e7e8b7bc2d765850d25 to your computer and use it in GitHub Desktop.
update docker-compose.yml for medium article with both api and database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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