Skip to content

Commit

Permalink
docker-compose: use dokcerized postgres db
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Mar 12, 2024
1 parent d581829 commit b24ab76
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.sample → .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

DB_HOST=localhost
DB_HOST=postgresql
DB_USERNAME=sfscon
DB_PASSWORD=__PLACE_YOUR_PASSWORD__
DB_PASSWORD=sfscon
DB_NAME=sfscon
DB_PORT=5432

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ app

- checkout this repository
- run docker compose build
- setup .env file (from .env.sample)
- setup .env file (from .env.example)
- setup global nginx (see configuration file in config/nginx.global.conf.sample
- run docker compose up -d

Expand All @@ -25,10 +25,10 @@ visible from docker containers on host.docker.internal
this is defined at the top of .env file as

```
DB_HOST=host.docker.internal
DB_USERNAME=opencon_user # or any other your username
DB_PASSWORD=__your_password__
DB_NAME=opencon_db # or any other database name
DB_HOST=postgres
DB_USERNAME=sfscon # or any other your username
DB_PASSWORD=sfscon
DB_NAME=sfscon # or any other database name
DB_PORT=5432
```

Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,15 @@ services:
volumes:
- ./src/:/app
- /var/log/opencon:/var/log/opencon

postgres:
image: "postgres:14-alpine"
environment:
POSTGRES_DB: sfscon
POSTGRES_USER: sfscon
POSTGRES_PASSWORD: sfscon
hostname: postgres
volumes:
- /tmp/epaper_pgdata:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT}:5432"

0 comments on commit b24ab76

Please sign in to comment.