Skip to content

Commit

Permalink
build: minor docker-compose.yml cleanup
Browse files Browse the repository at this point in the history
- Move Postgres database credentials to env
- Remove unnecessary `container_name` fields
  • Loading branch information
gabrielwong159 committed Jul 3, 2022
1 parent bbe20ab commit e27c407
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
16 changes: 10 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
DB_PORT=12345
DB_API_PORT=12346
TELEMSG_API_PORT=12347
WEB_API_PORT=12348
TELEGRAM_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
TELEGRAM_ADMIN_ID=123456789
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
DB_PORT=
DB_API_PORT=
TELEMSG_API_PORT=
WEB_API_PORT=
FRONTEND_API_PORT=
TELEGRAM_TOKEN=
TELEGRAM_ADMIN_ID=
12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ version: '3.3'
services:
db:
image: postgres:9.5
container_name: evs_postgres
volumes:
- "${HOME}/docker/volumes/postgres:/var/lib/postgresql/data"
ports:
- "${DB_PORT}:5432"
environment:
POSTGRES_DB: "evs"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "docker"
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
restart: "on-failure"


Expand All @@ -21,7 +20,6 @@ services:
- web_api
build: apis/db
image: evs-db-api:latest
container_name: evs_db_api
ports:
- "${DB_API_PORT}:8080"
environment:
Expand All @@ -34,7 +32,6 @@ services:
telemsg_api:
build: apis/telemsg
image: evs-telemsg-api:latest
container_name: evs_telemsg_api
ports:
- "${TELEMSG_API_PORT}:8080"
environment:
Expand All @@ -45,7 +42,6 @@ services:
web_api:
build: apis/web
image: evs-web-api:latest
container_name: evs_web_api
ports:
- "${WEB_API_PORT}:8080"
restart: "on-failure"
Expand All @@ -56,7 +52,6 @@ services:
- web_api
build: apis/front
image: evs-front-api:latest
container_name: evs_front_api
ports:
- "${FRONTEND_API_PORT}:8080"
environment:
Expand All @@ -73,7 +68,6 @@ services:
- web_api
build: hosts/telebot
image: evs-telebot:latest
container_name: evs_telebot
environment:
TELEGRAM_TOKEN: "${TELEGRAM_TOKEN}"
DB_API_HOST: "db_api"
Expand Down

0 comments on commit e27c407

Please sign in to comment.