Skip to content

Commit

Permalink
docker-compose.yml: switch from links to depends_on
Browse files Browse the repository at this point in the history
The `links` option is a legacy option that may eventually be
removed entirely. We switch to `depends_on` so that we are
still expressing the service dependencies.

Note that since `links` allows a `SERVICE:ALIAS` syntax, and
`depends_on` does not, we need to tell the `phpmyadmin` service
that the mysql container is called `mysql` and not `db`
(the latter being the default container name for the phpmyadmin
image).
  • Loading branch information
hemberger committed Mar 26, 2018
1 parent 24edd06 commit bf3c14e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ services:

smr:
extends: smr-common
# Links cannot be defined in extended services (i.e. smr-common)
links:
# depends_on cannot be defined in extended services (i.e. smr-common)
depends_on:
- mysql

smr-dev:
extends: smr-common
# Links cannot be defined in extended services (i.e. smr-common)
links:
# depends_on cannot be defined in extended services (i.e. smr-common)
depends_on:
- mysql
volumes:
# Mount the source code instead of copying it.
Expand All @@ -40,7 +40,7 @@ services:
flyway:
image: boxfuse/flyway:latest-alpine
command: -url=jdbc:mysql://${MYSQL_HOST}/smr_live -user=smr -password=${MYSQL_PASSWORD} migrate
links:
depends_on:
- mysql
volumes:
- ./db/patches:/flyway/sql:ro
Expand Down Expand Up @@ -68,8 +68,10 @@ services:
# Publish to port 8080
ports:
- 8080:80
links:
- mysql:db
environment:
PMA_HOST: mysql
depends_on:
- mysql

discord:
build:
Expand Down

0 comments on commit bf3c14e

Please sign in to comment.