aboutsummaryrefslogtreecommitdiffstats
path: root/docker-compose-postgres.yaml
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-05-15 14:41:39 +0000
committerterminaldweller <devi@terminaldweller.com>2024-05-15 14:41:39 +0000
commit006cb3a77d7437a60733c28abee0083e6f02ae90 (patch)
tree2cae44510125ce8eb09d4ee4e142396c7769536f /docker-compose-postgres.yaml
parentfixing the go executable build for github actions (diff)
downloadmilla-006cb3a77d7437a60733c28abee0083e6f02ae90.tar.gz
milla-006cb3a77d7437a60733c28abee0083e6f02ae90.zip
fixes #14, fixes #16, fixes #17, fixes #18, fixes #19, fixes #20
Diffstat (limited to 'docker-compose-postgres.yaml')
-rw-r--r--docker-compose-postgres.yaml102
1 files changed, 102 insertions, 0 deletions
diff --git a/docker-compose-postgres.yaml b/docker-compose-postgres.yaml
new file mode 100644
index 0000000..a10e79f
--- /dev/null
+++ b/docker-compose-postgres.yaml
@@ -0,0 +1,102 @@
+services:
+ terra:
+ image: milla_distroless_vendored
+ build:
+ context: .
+ dockerfile: ./Dockerfile_distroless_vendored
+ deploy:
+ resources:
+ limits:
+ memory: 128M
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "100m"
+ networks:
+ - terranet
+ user: 1000:1000
+ restart: unless-stopped
+ entrypoint: ["/usr/bin/milla"]
+ command: ["--config", "/config.toml"]
+ volumes:
+ - ./config-gpt.toml:/config.toml
+ - /etc/localtime:/etc/localtime:ro
+ cap_drop:
+ - ALL
+ environment:
+ - HTTPS_PROXY=http://172.17.0.1:8120
+ - https_proxy=http://172.17.0.1:8120
+ - HTTP_PROXY=http://172.17.0.1:8120
+ - http_proxy=http://172.17.0.1:8120
+ postgres:
+ image: postgres:16-alpine3.19
+ deploy:
+ resources:
+ limits:
+ memory: 4096M
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "200m"
+ restart: unless-stopped
+ ports:
+ - "127.0.0.1:5455:5432/tcp"
+ volumes:
+ - terra_postgres_vault:/var/lib/postgresql/data
+ - ./scripts/:/docker-entrypoint-initdb.d/:ro
+ environment:
+ - POSTGRES_PASSWORD_FILE=/run/secrets/pg_pass_secret
+ - POSTGRES_USER_FILE=/run/secrets/pg_user_secret
+ - POSTGRES_INITDB_ARGS_FILE=/run/secrets/pg_initdb_args_secret
+ - POSTGRES_DB_FILE=/run/secrets/pg_db_secret
+ networks:
+ - terranet
+ - dbnet
+ secrets:
+ - pg_pass_secret
+ - pg_user_secret
+ - pg_initdb_args_secret
+ - pg_db_secret
+ runtime: runsc
+ pgadmin:
+ image: dpage/pgadmin4:8.6
+ deploy:
+ resources:
+ limits:
+ memory: 1024M
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "100m"
+ environment:
+ - PGADMIN_LISTEN_PORT=${PGADMIN_LISTEN_PORT:-5050}
+ - PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:-devi@terminaldweller.com}
+ - PGADMIN_DEFAULT_PASSWORD_FILE=/run/secrets/pgadmin_pass
+ - PGADMIN_DISABLE_POSTFIX=${PGADMIN_DISABLE_POSTFIX:-YES}
+ ports:
+ - "127.0.0.1:5050:5050/tcp"
+ restart: unless-stopped
+ volumes:
+ - terra_pgadmin_vault:/var/lib/pgadmin
+ networks:
+ - dbnet
+ secrets:
+ - pgadmin_pass
+networks:
+ terranet:
+ driver: bridge
+ dbnet:
+volumes:
+ terra_postgres_vault:
+ terra_pgadmin_vault:
+secrets:
+ pg_pass_secret:
+ file: ./pg/pg_pass_secret
+ pg_user_secret:
+ file: ./pg/pg_user_secret
+ pg_initdb_args_secret:
+ file: ./pg/pg_initdb_args_secret
+ pg_db_secret:
+ file: ./pg/pg_db_secret
+ pgadmin_pass:
+ file: ./pgadmin/pgadmin_pass