Skip to content

Commit

Permalink
refactor: renamed services in docker-compose.test.yml and cleaned up …
Browse files Browse the repository at this point in the history
…entrypoint.sh.
  • Loading branch information
michaelhiiva committed Nov 20, 2021
1 parent 7d72267 commit 5de4ab9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
version: '3.5'

services:
app:
test_app:
build: ./
restart: always
environment:
DB_HOST: db
DB_HOST: test_db
DB_PORT: 3306
APP_DB_NAME: agagd
AGAGD_USER: agagd
Expand All @@ -30,15 +30,16 @@ services:
- ./agagd/static:/srv/static
- ./agagd/jinja2:/srv/jinja2
- ./agagd/templates:/srv/templates
command: "python manage.py test"
depends_on:
- "db"
db:
- "test_db"
test_db:
build:
context: ./
dockerfile: Dockerfile.mysql
restart: always
volumes:
- database:/var/lib/mysql
- test_database:/var/lib/mysql
environment:
# This is safer than it looks, since without a 'ports' section, docker-compose
# isolates this app to a network local to this compose file.
Expand All @@ -49,4 +50,4 @@ services:
MYSQL_PASSWORD: "${MYSQL_PASSWORD}"

volumes:
database:
test_database:
2 changes: 1 addition & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function wait_for_db() {
exit 1
}

if [ "$3" != "test" ]; then
if [[ "$3" != "test" ]]; then
wait_for_db
fi

Expand Down

0 comments on commit 5de4ab9

Please sign in to comment.