Parameterize coolify.yml env vars

This commit is contained in:
alexandrump
2026-02-09 01:40:43 +01:00
parent 28e30ede18
commit 5f711f30f8

View File

@@ -2,9 +2,9 @@ apps:
- name: gob-alert-postgres - name: gob-alert-postgres
image: postgres:15-alpine image: postgres:15-alpine
env: env:
POSTGRES_USER: gob POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: gobpass POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: gob_alert POSTGRES_DB: ${POSTGRES_DB}
- name: gob-alert-redis - name: gob-alert-redis
image: redis:7-alpine image: redis:7-alpine
@@ -14,9 +14,9 @@ apps:
dockerfile: Dockerfile dockerfile: Dockerfile
env: env:
- key: DATABASE_URL - key: DATABASE_URL
value: postgres://gob:gobpass@gob-alert-postgres:5432/gob_alert value: ${DATABASE_URL}
- key: API_ADMIN_KEY - key: API_ADMIN_KEY
value: changeme value: ${API_ADMIN_KEY}
ports: ports:
- 3000 - 3000
@@ -25,11 +25,15 @@ apps:
dockerfile: Dockerfile dockerfile: Dockerfile
env: env:
- key: API_URL - key: API_URL
value: http://gob-alert-api:3000 value: ${API_URL}
ports: ports:
- 3001 - 3000
notes: | notes: |
This file provides a simple mapping for Coolify to build and deploy services from this repository. This file provides a simple mapping for Coolify to build and deploy services from this repository.
Adjust `DATABASE_URL` host when Coolify provides internal network hostnames. Use the Coolify UI Set required variables in Coolify (Project → Environment Variables):
to set secrets/variables in the target environment. - POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB
- DATABASE_URL (example: postgres://gob:***@gob-alert-postgres:5432/gob_alert)
- API_ADMIN_KEY
- API_URL (example: http://gob-alert-api:3000)
For production, keep the API internal (no public domain) and attach the domain to the web service.