diff --git a/Jenkinsfile b/Jenkinsfile index 3d6e5e5..3cc2a18 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { steps { sh 'rm .env || true' sh 'echo "PORT=8007" >> .env' - sh 'echo "DB_HOST=localhost" >> .env' + sh 'echo "DB_HOST=music-to-go-db" >> .env' sh 'echo "DB_PORT=5432" >> .env' sh 'echo "DB_DATABASE=music" >> .env' sh 'echo "DB_USERNAME=root" >> .env' diff --git a/docker-compose.yml b/docker-compose.yml index b5fbb7b..cca91e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,17 @@ services: music-to-go: container_name: music-to-go + depends_on: + - music-to-go-db build: context: . dockerfile: Dockerfile ports: - "8007:8007" restart: unless-stopped + networks: + - music-to-go-network + music-to-go-db: image: postgres container_name: music-to-go-db @@ -18,4 +23,10 @@ services: environment: POSTGRES_USER: root POSTGRES_PASSWORD: root + networks: + - music-to-go-network + +networks: + music-to-go-network: + driver: bridge