feat: added dockerfiles and docker compose setup

This commit is contained in:
ITQ
2025-11-11 21:39:25 +03:00
parent 2c5b1c1dd6
commit f93bcaea03
10 changed files with 3458 additions and 0 deletions
+158
View File
@@ -0,0 +1,158 @@
name: order
services:
core:
build:
context: .
dockerfile: Containerfile
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
redis:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/core/.env.template
required: true
- path: ./infrastructure/core/.env
ports:
- name: http
target: 8080
published: 13440
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
- name: grpc
target: 50051
published: 13441
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
networks:
- default
restart: unless-stopped
shm_size: 4mb
postgres:
image: docker.io/postgres:17-alpine
configs:
- source: postgres_config
target: /etc/postgresql/postgresql.conf
env_file:
- path: ./infrastructure/postgres/.env.template
required: true
- path: ./infrastructure/postgres/.env
required: false
healthcheck:
test: [ "CMD", "pg_isready", "--dbname=postgres" ]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
networks:
- default
oom_kill_disable: true
restart: unless-stopped
shm_size: 128mb
volumes:
- type: volume
source: postgres_data
target: /var/lib/postgresql/data
pgadmin:
image: docker.io/dpage/pgadmin4:9
configs:
- source: pgadmin_servers_config
target: /pgadmin4/servers.json
depends_on:
postgres:
restart: false
condition: service_healthy
required: true
env_file:
- path: ./infrastructure/pgadmin/.env.template
required: true
- path: ./infrastructure/pgadmin/.env
required: false
healthcheck:
test: ["CMD", "wget", "-O", "-", "http://localhost:80/misc/ping"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
ports:
- name: web
target: 80
published: 13442
host_ip: 127.0.0.1
protocol: tcp
app_protocol: http
networks:
- default
profiles:
- observability
restart: unless-stopped
shm_size: 4mb
volumes:
- type: volume
source: pgadmin_data
target: /var/lib/pgadmin
read_only: false
redis:
image: docker.io/redis:8-alpine
command: redis-server /usr/local/etc/redis/redis.conf
configs:
- source: redis_config
target: /usr/local/etc/redis/redis.conf
env_file:
- path: ./infrastructure/redis/.env.template
required: true
- path: ./infrastructure/redis/.env
required: false
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1m30s
timeout: 5s
start_period: 5s
start_interval: 2s
retries: 5
networks:
- default
restart: unless-stopped
shm_size: 4mb
volumes:
- type: volume
source: redis_data
target: /data
read_only: false
networks:
default:
driver: bridge
name: $COMPOSE_PROJECT_NAME
attachable: false
enable_ipv4: true
enable_ipv6: true
internal: false
volumes:
postgres_data:
pgadmin_data:
redis_data:
configs:
postgres_config:
file: ./infrastructure/postgres/postgresql.conf
pgadmin_servers_config:
file: ./infrastructure/pgadmin/servers.json
redis_config:
file: ./infrastructure/redis/redis.conf