Update infrastructure to use external PostgreSQL server instead of Docker container. Modify .env.example and documentation to reflect new connection settings and deployment instructions.
This commit is contained in:
+1
-29
@@ -1,39 +1,14 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-telewave}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-telewave}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-telewave}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-telewave} -d ${POSTGRES_DB:-telewave}']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: '10m'
|
||||
max-file: '3'
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
# Секреты (Jwt__SigningKey, AdminSeed__Password, ...) — из .env, см. .env.example.
|
||||
# ConnectionStrings__Default ниже переопределяет .env: адрес БД внутри сети compose всегда 'db'.
|
||||
# Postgres — внешний (не в compose), см. ConnectionStrings__Default в .env.
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
ASPNETCORE_HTTP_PORTS: '8085'
|
||||
ConnectionStrings__Default: 'Host=db;Port=5432;Database=${POSTGRES_DB:-telewave};Username=${POSTGRES_USER:-telewave};Password=${POSTGRES_PASSWORD:-telewave}'
|
||||
healthcheck:
|
||||
test: ['CMD', 'curl', '-f', 'http://localhost:8085/health']
|
||||
interval: 15s
|
||||
@@ -48,6 +23,3 @@ services:
|
||||
options:
|
||||
max-size: '10m'
|
||||
max-file: '3'
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
|
||||
Reference in New Issue
Block a user