generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ce67b2
commit 78ab2ca
Showing
9 changed files
with
72 additions
and
38 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,2 @@ | ||
* text=auto | ||
*.sh text eol=lf |
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 |
---|---|---|
|
@@ -10,23 +10,41 @@ services: | |
condition: service_healthy | ||
env_file: | ||
- .env | ||
environment: | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?Variable not set} | ||
ports: | ||
- 8000:8000 | ||
|
||
db: | ||
image: postgres:12 | ||
image: postgres:16 | ||
restart: unless-stopped | ||
volumes: | ||
- app-db-data:/var/lib/postgresql/data/pgdata | ||
- ./database/:/docker-entrypoint-initdb.d/:cached | ||
env_file: | ||
- .env | ||
environment: | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set} | ||
- POSTGRES_USER=${POSTGRES_USER?Variable not set} | ||
- POSTGRES_DB=${POSTGRES_DB?Variable not set} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?Variable not set} | ||
- SECRET_KEY=${SECRET_KEY:?Variable not set} | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready", "-d", "tad"] | ||
test: ["CMD-SHELL", "pg_isready", "-d", "tad", "-U", "postgres"] | ||
start_period: 10s | ||
|
||
|
||
db-admin: | ||
image: dpage/pgadmin4:8.6 | ||
restart: unless-stopped | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:[email protected]} | ||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:?Variable not set} | ||
- PGADMIN_LISTEN_PORT=${PGADMIN_LISTEN_PORT:-8080} | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
|
||
|
||
#TODO(berry): Traefik | ||
|
||
|
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,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# todo(berry): make user and database variables | ||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL | ||
CREATE USER tad WITH PASSWORD 'changethis'; | ||
CREATE DATABASE tad; | ||
GRANT ALL PRIVILEGES ON DATABASE tad TO tad; | ||
EOSQL |
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