generated from phucvinh57/fastify-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cd): separate ports and docker-compose file for test deployment s…
…ervice and developer service Refactor the project to use distinct ports and Docker-compose files for the test deployment service and the developer service. Introduce separate naming conventions and utilize new environment variables for improved clarity and maintainability.
- Loading branch information
Showing
3 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: "3.5" | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
container_name: ssps-db-test-deploy | ||
env_file: | ||
- .env | ||
ports: | ||
- "${POSTGRES_TEST_PORT:-6432}:5432" | ||
volumes: | ||
- postgres_db:/var/lib/postgresql/data | ||
restart: always | ||
networks: | ||
- ssps | ||
|
||
#docker build -t ssps-be:test-deploy . | ||
fastify: | ||
image: ghcr.io/ticklabvn/ssps-be-test-deploy:latest | ||
container_name: ssps-be-test-deploy | ||
env_file: | ||
- .env | ||
ports: | ||
- "${FASTIFY_TEST_PORT:-9080}:8080" | ||
volumes: | ||
- .env:/app/.env | ||
depends_on: | ||
- postgres | ||
restart: always | ||
networks: | ||
- ssps | ||
|
||
volumes: | ||
postgres_db: | ||
|
||
networks: | ||
ssps: | ||
name: ssps-test-deploy | ||
external: true | ||
|
||
# run the following command after docker compose up to create seed data: | ||
# docker-compose exec fastify npx prisma db seed | ||
# if the ssps network haven't created yet, run the following command: | ||
# docker network create --driver bridge ssps-test-deploy |