Skip to content

Commit

Permalink
chore: change postgres to individual compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
tylovejoy committed May 11, 2024
1 parent c632c9f commit e553a81
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 44 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/deploy-development.yml

This file was deleted.

42 changes: 23 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,35 @@ services:
syslog-format: "rfc5424"
syslog-address: "${LOGGING_URL}"
container_name: doom-bot
env_file:
- .env
build: .
environment:
- TOKEN=${TOKEN}
- POSTGRES_PASSWORD=${PSQL_PASSWORD}
- POSTGRES_USER=${PSQL_USER}
- PSQL_PASSWORD=${PSQL_PASSWORD}
- PSQL_USER=${PSQL_USER}
- PSQL_HOST=${PSQL_HOST}
- PSQL_DATABASE=${PSQL_DATABASE}
- PSQL_PORT=${PSQL_PORT}
depends_on:
- db
db:
container_name: doom-postgres
env_file:
- .env
build: ./postgres/
restart: unless-stopped
ports:
- "9889:5432"
volumes:
- "$HOME/doom-postgres/:/var/lib/postgresql/data"
environment:
- POSTGRES_PASSWORD=${PSQL_PASSWORD}
- POSTGRES_USER=${PSQL_USER}
networks:
- postgres_doom-network
networks:
postgres_doom-network:
external: true

# depends_on:
# - db
# db:
# container_name: doom-postgres
# env_file:
# - .env
# build: ./postgres/
# restart: unless-stopped
# ports:
# - "9889:5432"
# volumes:
# - "$HOME/doom-postgres/:/var/lib/postgresql/data"
# environment:
# - POSTGRES_PASSWORD=${PSQL_PASSWORD}
# - POSTGRES_USER=${PSQL_USER}
# grafana:
# container_name: shimada-grafana
# env_file:
Expand Down
3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ async def main() -> None:
async with database.DatabaseConnection(
f"postgres://"
f"{os.environ['PSQL_USER']}:"
f"{os.environ['PSQL_PASSWORD']}@db/"
f"{os.environ['PSQL_DATABASE']}"
f"{os.environ['PSQL_PASSWORD']}@db/doom3"
) as pool:
assert pool is not None
async with core.Doom() as bot:
Expand Down
40 changes: 40 additions & 0 deletions postgres/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
services:
db:
container_name: doom-postgres
build: .
restart: unless-stopped
ports:
- "5432"
volumes:
- "$HOME/doom-postgres/:/var/lib/postgresql/data"
environment:
- POSTGRES_PASSWORD=${PSQL_PASSWORD}
- POSTGRES_USER=${PSQL_USER}
networks:
- doom-network

dbgate:
image: dbgate/dbgate
restart: always
ports:
- 3000:3000
volumes:
- dbgate-data:/root/.dbgate
environment:
CONNECTIONS: psql
SINGLE_CONNECTION: psql
LABEL_psql: Postgres - Doom
SERVER_psql: db
PORT_psql: 5432
PASSWORD_MODE_psql: askUser
ENGINE_psql: postgres@dbgate-plugin-postgres
networks:
- doom-network


volumes:
dbgate-data:
driver: local

networks:
doom-network:

0 comments on commit e553a81

Please sign in to comment.