modified: serv_nginx/docker-compose.yml
modified: serv_nginx/nginx/nginx-ssl.conf deleted: serv_nginx/serv_golang_rest_api/docker-compose.yaml add / slash to api path proxy_pass
This commit is contained in:
@@ -40,6 +40,7 @@ services:
|
||||
- app-network
|
||||
depends_on:
|
||||
- certbot
|
||||
- serv_golang_rest_api
|
||||
|
||||
api:
|
||||
build:
|
||||
@@ -66,7 +67,7 @@ services:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
retries: 3s
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
|
||||
@@ -43,7 +43,7 @@ server {
|
||||
|
||||
# New location for REST API
|
||||
location /api {
|
||||
proxy_pass http://serv_golang_rest_api:8080;
|
||||
proxy_pass http://serv_golang_rest_api:8080/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
services:
|
||||
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: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user