docker compose own reverse proxy

This commit is contained in:
Martin Biolek 2023-02-17 21:04:27 +01:00
parent 91f6d388eb
commit 140f794b43
2 changed files with 58 additions and 1 deletions

View file

@ -0,0 +1,48 @@
version: '3'
services:
boltcard:
build:
context: ./
dockerfile: Dockerfile
container_name: boltcard_main
depends_on:
- db
restart: unless-stopped
environment:
- LOG_LEVEL=DEBUG
- DB_HOST=db
- DB_USER=cardapp
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=5432
- DB_NAME=card_db
expose:
- "9000"
ports:
- "8080:9000"
volumes:
- ${PWD}/tls.cert:/boltcard/tls.cert
- ${PWD}/admin.macaroon:/boltcard/admin.macaroon
networks:
- boltnet
db:
image: postgres
container_name: boltcard_db
restart: unless-stopped
environment:
- POSTGRES_USER=cardapp
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=card_db
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- db-data:/var/lib/postgresql/data
- ./select_db.sql:/docker-entrypoint-initdb.d/select_db.sql
- ./create_db.sql:/docker-entrypoint-initdb.d/create_db.sql
- ./settings.sql:/docker-entrypoint-initdb.d/settings.sql
expose:
- "5432"
networks:
- boltnet
networks:
boltnet:
volumes:
db-data:

View file

@ -18,7 +18,7 @@
- copy the `.env.example` file to `.env` and change the database password
### service bring-up and running
### run service bring-up and running
```
$ sudo groupadd docker
$ sudo usermod -aG docker ${USER}
@ -28,6 +28,15 @@ $ docker volume create caddy_data
$ docker compose up
```
### run boltcard server with own reverse proxy
If you already have reverse proxy in your enviroment which controls/terminates TLS connections, Boltcard server wont be ready to use, because of existence of own reverse proxy (Caddy). Caddy wont be abble to obtain TLS certificate for your domain name. Run different docker-compose, that will start Boltcard server without Caddy and your reverse proxy will handle TLS.
```
// add -d option for detached mode
$ docker-compose up -f docker-compose-own-reverse-proxy.yml
```
### stop docker
```
$ docker compose down