First commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# Kilometer Log — Portainer stack (web editor).
|
||||
#
|
||||
# All settings come from the stack's "Environment variables" in Portainer, not from a .env file:
|
||||
# - ${...} below is filled in by Portainer from those variables (needed for the Traefik labels);
|
||||
# - stack.env is the file Portainer writes from those same variables; both containers load it.
|
||||
# See stack.env.example for the variables to add.
|
||||
#
|
||||
# The app image is built on the Docker host first (the web editor cannot build):
|
||||
# docker build -t kilometer-log:latest .
|
||||
services:
|
||||
kilometer-log:
|
||||
image: kilometer-log:latest
|
||||
pull_policy: never # use the image built on this server, never pull it
|
||||
container_name: kilometer-log
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- stack.env # Portainer's environment variables (POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, ...)
|
||||
environment:
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
networks:
|
||||
- traefik
|
||||
- backend
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=${TRAEFIK_NETWORK:-traefik}"
|
||||
- "traefik.http.routers.kilometer-log.rule=Host(`${APP_HOST:?Add APP_HOST to the stack's environment variables in Portainer}`)"
|
||||
- "traefik.http.routers.kilometer-log.entrypoints=${TRAEFIK_ENTRYPOINT:-websecure}"
|
||||
- "traefik.http.routers.kilometer-log.tls=true"
|
||||
- "traefik.http.routers.kilometer-log.tls.certresolver=${TRAEFIK_CERTRESOLVER:-letsencrypt}"
|
||||
- "traefik.http.services.kilometer-log.loadbalancer.server.port=3000"
|
||||
# The app has no login of its own. Uncomment to protect it with basic auth
|
||||
# (add BASIC_AUTH_USERS to the stack's environment variables, see README):
|
||||
# - "traefik.http.routers.kilometer-log.middlewares=kilometer-log-auth"
|
||||
# - "traefik.http.middlewares.kilometer-log-auth.basicauth.users=${BASIC_AUTH_USERS}"
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: kilometer-log-db
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- stack.env # POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD from Portainer
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-kilometerlog} -d $${POSTGRES_DB:-kilometerlog}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
external: true
|
||||
name: ${TRAEFIK_NETWORK:-traefik}
|
||||
backend:
|
||||
internal: true
|
||||
Reference in New Issue
Block a user