merge services api and nginx

This commit is contained in:
2025-10-05 23:27:19 +05:00
parent fd329f120d
commit c73701cf5c
29 changed files with 50 additions and 4 deletions
+49 -3
View File
@@ -37,18 +37,64 @@ services:
networks:
- web-network
- internal
- serv_golang_rest_api_app-network # сеть API
- app-network
depends_on:
- certbot
api:
build:
context: ./serv_golang_rest_api
dockerfile: Dockerfile
ports:
- "8888:8080"
container_name: serv_golang_rest_api
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
# Database connection settings
DB_HOST: db
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: mydb
APP_PORT: 8080
networks:
- app-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
db:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mydb
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 10s
retries: 5
volumes:
certbot_data:
certbot_www:
postgres_data:
networks:
web-network:
driver: bridge
internal:
serv_golang_rest_api_app-network:
external: true
app-network:
name: serv_golang_rest_api_app-network
@@ -1,7 +1,7 @@
services:
api:
build:
context: .
context: ./serv_golang_rest_api
dockerfile: Dockerfile
ports:
- "8888:8080"