add docker
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
2026-10-23 00:39:04 +05:00
parent 965b00dba5
commit e5f01d0e94
16 changed files with 463 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
services:
main-db:
# Keep in sync with the runtime stage in Dockerfile: pg_dump must match this major version.
image: postgres:14.1-alpine
container_name: "main-db"
restart: always
@@ -11,31 +12,44 @@ services:
- '5424:5432'
volumes:
- main-db-storage:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U bank_admin -d bank_db"]
interval: 5s
timeout: 5s
retries: 20
networks:
- myNetwork
main-server:
image: main-app
image: main-app:latest
restart: unless-stopped
container_name: "main-app"
build:
context: .
dockerfile: Dockerfile
environment:
- TZ=Asia/Ashgabat
ports:
- "5050:5050"
volumes:
# Inside this network the config must point at main-db:5432 and main-minio:9000.
- ./config.yaml:/app/config.yaml:ro
- ./public:/app/public
- ./logs:/app/logs
depends_on:
- main-db
- main-minio
main-db:
condition: service_healthy
main-minio:
condition: service_started
networks:
- myNetwork
main-minio:
image: main-minio:latest
container_name: "main-minio"
build:
context: .
dockerfile: deployment/Dockerfile.minio
context: ./deployment
dockerfile: Dockerfile.minio
restart: unless-stopped
environment:
- MINIO_ROOT_USER=TX3H1H6XTS288QW07S8Z
@@ -54,4 +68,4 @@ volumes:
networks:
myNetwork:
driver: bridge
driver: bridge