-
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.
feat: add docker-compose.yml creating proxy, backend and db services
Closes: #14
- Loading branch information
1 parent
55eb1b5
commit a835f45
Showing
2 changed files
with
73 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
volumes: | ||
db-data: | ||
runtime-data: | ||
|
||
networks: | ||
public: | ||
private: | ||
|
||
secrets: | ||
postgres_password_secret: | ||
file: ./backend/runtime/secrets/postgres_password_secret | ||
|
||
services: | ||
db: | ||
image: postgres:16.3-alpine | ||
networks: | ||
- private | ||
environment: | ||
- POSTGRES_USER=kernelci | ||
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password_secret | ||
- PGDATA=/var/run/postgresql/data | ||
volumes: | ||
- db-data:/var/run/postgresql/data | ||
ports: | ||
- target: 5432 | ||
published: 5432 | ||
protocol: tcp | ||
mode: host | ||
secrets: | ||
- postgres_password_secret | ||
|
||
backend: | ||
build: ./backend | ||
restart: always | ||
networks: | ||
- private | ||
- public | ||
ports: | ||
- target: 8000 | ||
published: 8000 | ||
protocol: tcp | ||
mode: host | ||
secrets: | ||
- postgres_password_secret | ||
environment: | ||
- 'ALLOWED_HOSTS=["backend"]' | ||
- DB_DEFAULT_PASSWORD_FILE=/run/secrets/postgres_password_secret | ||
- DB_DEFAULT_HOST=db | ||
|
||
proxy: | ||
build: ./proxy | ||
restart: always | ||
depends_on: | ||
- backend | ||
networks: | ||
- public | ||
ports: | ||
- target: 80 | ||
published: 80 | ||
protocol: tcp | ||
mode: host | ||
environment: | ||
- PROXY_TARGET=http://backend:8000 |