Skip to content

Commit

Permalink
Adds DB volume to docker compose Db (leaderboardsgg#220)
Browse files Browse the repository at this point in the history
Under the current setup - no database changes are saved if
a container gets shut down. Adding a volume lets
the database persist between compose runs.
  • Loading branch information
Eein authored Aug 13, 2024
1 parent b08efce commit 4ec534a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,6 @@ FodyWeavers.xsd
*.env
!example.env
!swagger-gen.env

# Github Codespaces
.devcontainer/
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
POSTGRES_USER: ${ApplicationContext__PG__USER}
POSTGRES_PASSWORD: ${ApplicationContext__PG__PASSWORD}
POSTGRES_DB: ${ApplicationContext__PG__DB}
volumes:
- 'db_data:/var/lib/postgresql/data'
ports:
- ${ApplicationContext__PG__PORT}:5432

Expand All @@ -17,3 +19,5 @@ services:
restart: always
ports:
- ${ADMINER_PORT}:8080
volumes:
db_data:

0 comments on commit 4ec534a

Please sign in to comment.