Gitea Actions CI: tests, image build to registry.sagifer.com, SSH deploy
- .gitea/workflows/ci.yml: test (Postgres service), build and push the four images tagged with the commit hash, deploy over SSH when DEPLOY_HOST is set - ci/runner: act_runner 0.6.1 on the dev server using the host's Docker - deploy/: production compose with Caddy (https), daily pg_dump backups, log rotation; setup guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -0,0 +1,127 @@
|
|||||||
|
# Tests, image build and deployment on every push to main.
|
||||||
|
#
|
||||||
|
# Runs on the self-hosted runner in ci/runner (label `linux`). Jobs use the
|
||||||
|
# host's Docker daemon, so image builds share its BuildKit cache.
|
||||||
|
#
|
||||||
|
# Repository settings (Settings → Actions):
|
||||||
|
# secrets.REGISTRY_TOKEN Gitea access token with package write access
|
||||||
|
# secrets.DEPLOY_SSH_KEY private key of the deploy user on the server
|
||||||
|
# vars.DEPLOY_HOST user@host of the server; deployment is skipped when unset
|
||||||
|
# vars.DEPLOY_KNOWN_HOSTS `ssh-keyscan <host>` output
|
||||||
|
# vars.DEPLOY_PATH directory on the server (default /opt/sorsfonalak)
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: registry.sagifer.com
|
||||||
|
IMAGE_PREFIX: registry.sagifer.com/sagifer/sorsfonalak
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: sh
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: linux
|
||||||
|
container:
|
||||||
|
image: rust:1.99-alpine
|
||||||
|
# Kept between runs, so only changed crates are compiled again.
|
||||||
|
volumes:
|
||||||
|
- sorsfonalak-ci-cargo:/usr/local/cargo/registry
|
||||||
|
- sorsfonalak-ci-target:/ci-target
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:18-alpine
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: sorsfonalak
|
||||||
|
POSTGRES_PASSWORD: ci
|
||||||
|
POSTGRES_DB: sorsfonalak
|
||||||
|
env:
|
||||||
|
CARGO_TARGET_DIR: /ci-target
|
||||||
|
DATABASE_URL: postgres://sorsfonalak:ci@postgres:5432/sorsfonalak
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apk add --no-cache -q git musl-dev
|
||||||
|
git init -q . && git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
|
||||||
|
git fetch -q --depth 1 origin "${{ github.sha }}" && git checkout -q FETCH_HEAD
|
||||||
|
- name: Wait for Postgres
|
||||||
|
run: |
|
||||||
|
for i in $(seq 30); do nc -z postgres 5432 && exit 0; sleep 1; done
|
||||||
|
echo "postgres did not start" >&2; exit 1
|
||||||
|
# astro-engine and horoscope-api need the Swiss Ephemeris sources and
|
||||||
|
# data (scripts/fetch-deps.sh); their tests run locally.
|
||||||
|
- name: Test
|
||||||
|
run: cargo test --locked -p backend -p worker -p db -p horoscope-client -p service-kit
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: test
|
||||||
|
runs-on: linux
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apk add --no-cache -q git
|
||||||
|
git init -q . && git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
|
||||||
|
git fetch -q --depth 1 origin "${{ github.sha }}" && git checkout -q FETCH_HEAD
|
||||||
|
- name: Log in to the registry
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
run: printf '%s' "$TOKEN" | docker login "$REGISTRY" -u "${{ github.repository_owner }}" --password-stdin
|
||||||
|
# The frontend build also type-checks the TypeScript code.
|
||||||
|
- name: Build and push images
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
tag=$(echo "${{ github.sha }}" | cut -c1-12)
|
||||||
|
build() {
|
||||||
|
image="$IMAGE_PREFIX-$1"; shift
|
||||||
|
docker build --label sorsfonalak.ci=1 -t "$image:$tag" -t "$image:latest" "$@"
|
||||||
|
docker push -q "$image:$tag"
|
||||||
|
docker push -q "$image:latest"
|
||||||
|
}
|
||||||
|
build horoscope-api -f services/horoscope-api/Dockerfile .
|
||||||
|
build backend -f services/backend/Dockerfile .
|
||||||
|
build worker -f services/worker/Dockerfile .
|
||||||
|
build frontend services/frontend
|
||||||
|
- name: Clean up
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker logout "$REGISTRY" || true
|
||||||
|
docker image prune -f --filter label=sorsfonalak.ci=1 >/dev/null
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
if: vars.DEPLOY_HOST != ''
|
||||||
|
runs-on: linux
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apk add --no-cache -q git openssh-client
|
||||||
|
git init -q . && git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
|
||||||
|
git fetch -q --depth 1 origin "${{ github.sha }}" && git checkout -q FETCH_HEAD
|
||||||
|
- name: SSH key
|
||||||
|
env:
|
||||||
|
KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||||
|
KNOWN_HOSTS: ${{ vars.DEPLOY_KNOWN_HOSTS }}
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
||||||
|
(umask 077 && printf '%s\n' "$KEY" > ~/.ssh/id_ed25519)
|
||||||
|
printf '%s\n' "$KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
|
# Copies the compose files, pins TAG in the server's .env and restarts
|
||||||
|
# the changed services. The database migrations run when the backend starts.
|
||||||
|
- name: Deploy
|
||||||
|
env:
|
||||||
|
HOST: ${{ vars.DEPLOY_HOST }}
|
||||||
|
DIR: ${{ vars.DEPLOY_PATH || '/opt/sorsfonalak' }}
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
tag=$(echo "${{ github.sha }}" | cut -c1-12)
|
||||||
|
scp -q deploy/docker-compose.yml deploy/Caddyfile "$HOST:$DIR/"
|
||||||
|
ssh "$HOST" "cd '$DIR' && \
|
||||||
|
(grep -q '^TAG=' .env && sed -i 's/^TAG=.*/TAG=$tag/' .env || echo 'TAG=$tag' >> .env) && \
|
||||||
|
docker compose pull -q && docker compose up -d --remove-orphans --wait && \
|
||||||
|
docker image prune -f >/dev/null"
|
||||||
@@ -33,6 +33,8 @@ A `docker compose up` a `docker-compose.override.yml` fájlt is betölti. Ebben
|
|||||||
SMTP_URL=smtps://user:jelszo@smtp.example.com:465 docker compose -f docker-compose.yml up -d
|
SMTP_URL=smtps://user:jelszo@smtp.example.com:465 docker compose -f docker-compose.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Az éles szerverre a CI telepít (Gitea Actions, Caddy és https): lásd [deploy/README.md](deploy/README.md).
|
||||||
|
|
||||||
A horoscope-api image önálló (`scratch` alapú, kb. 70 MB, nem root felhasználóval fut). Benne van a statikus bináris és az összes adat. A container induláskor ~2 mp alatt betölti az adatokat, és ~190 MB memóriát használ. Egy horoszkóp kiszámítása 2–3 ms.
|
A horoscope-api image önálló (`scratch` alapú, kb. 70 MB, nem root felhasználóval fut). Benne van a statikus bináris és az összes adat. A container induláskor ~2 mp alatt betölti az adatokat, és ~190 MB memóriát használ. Egy horoszkóp kiszámítása 2–3 ms.
|
||||||
|
|
||||||
Build-argumentumok (`docker compose build --build-arg …`):
|
Build-argumentumok (`docker compose build --build-arg …`):
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# act_runner configuration (see `act_runner generate-config` for every option).
|
||||||
|
log:
|
||||||
|
level: info
|
||||||
|
|
||||||
|
runner:
|
||||||
|
file: .runner
|
||||||
|
capacity: 1
|
||||||
|
timeout: 1h
|
||||||
|
# Jobs without their own `container:` run in the Docker CLI image.
|
||||||
|
labels:
|
||||||
|
- "linux:docker://docker:29.9.3-cli"
|
||||||
|
|
||||||
|
cache:
|
||||||
|
# Not used: the cargo and BuildKit caches live in Docker volumes.
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
container:
|
||||||
|
network: ""
|
||||||
|
privileged: false
|
||||||
|
# The host's Docker socket is mounted into every job container (docker_host
|
||||||
|
# empty), so `docker build` uses the host daemon and its build cache.
|
||||||
|
docker_host: ""
|
||||||
|
# Only the CI cache volumes may be mounted by workflows.
|
||||||
|
valid_volumes:
|
||||||
|
- "sorsfonalak-ci-*"
|
||||||
|
force_pull: false
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# Gitea Actions runner for this repository, on the dev server.
|
||||||
|
#
|
||||||
|
# First start (registers the runner; the token is only needed once):
|
||||||
|
# GITEA_RUNNER_REGISTRATION_TOKEN=... docker compose up -d
|
||||||
|
# Afterwards: docker compose up -d
|
||||||
|
|
||||||
|
services:
|
||||||
|
runner:
|
||||||
|
image: gitea/act_runner:0.6.1
|
||||||
|
environment:
|
||||||
|
CONFIG_FILE: /config.yaml
|
||||||
|
GITEA_INSTANCE_URL: ${GITEA_INSTANCE_URL:-http://10.0.0.114:30008}
|
||||||
|
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN:-}
|
||||||
|
GITEA_RUNNER_NAME: ${GITEA_RUNNER_NAME:-dev-195}
|
||||||
|
volumes:
|
||||||
|
- ./config.yaml:/config.yaml:ro
|
||||||
|
# Registration (.runner) lives here.
|
||||||
|
- runner-data:/data
|
||||||
|
# Job containers are started on the host daemon.
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
runner-data:
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Copy to /opt/sorsfonalak/.env on the server and fill in.
|
||||||
|
|
||||||
|
# Public domain (Caddy gets the certificate for it and www.<domain>)
|
||||||
|
DOMAIN=sorsfonalak.hu
|
||||||
|
# Long random string: openssl rand -hex 24
|
||||||
|
POSTGRES_PASSWORD=
|
||||||
|
|
||||||
|
# Google OAuth client ID(s), comma-separated
|
||||||
|
GOOGLE_CLIENT_IDS=
|
||||||
|
# These accounts become admins at their first login
|
||||||
|
BOOTSTRAP_ADMIN_EMAILS=
|
||||||
|
|
||||||
|
# Outgoing mail, e.g. smtps://user:password@smtp.example.com:465
|
||||||
|
SMTP_URL=
|
||||||
|
MAIL_FROM=Sorsfonalak <noreply@sorsfonalak.hu>
|
||||||
|
|
||||||
|
# Image version; every deployment rewrites it
|
||||||
|
TAG=latest
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# HTTPS certificate from Let's Encrypt for $DOMAIN (DNS must point here).
|
||||||
|
{$DOMAIN} {
|
||||||
|
encode zstd gzip
|
||||||
|
reverse_proxy frontend:3000
|
||||||
|
}
|
||||||
|
|
||||||
|
www.{$DOMAIN} {
|
||||||
|
redir https://{$DOMAIN}{uri} permanent
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# Build és telepítés
|
||||||
|
|
||||||
|
Minden `main`-re pusholt commit után lefut a `.gitea/workflows/ci.yml` (Gitea Actions):
|
||||||
|
|
||||||
|
1. **test**: `cargo test` a backendre, a workerre, a db-re, a horoscope-clientre és a service-kitre, egy Postgres szolgáltatás-konténerrel.
|
||||||
|
2. **build**: megépíti a négy image-et, és feltölti őket a `registry.sagifer.com/sagifer/sorsfonalak-<szolgáltatás>` címre. A címke a commit hash első 12 karaktere, plusz `latest`. A frontend buildje a TypeScript-típusokat is ellenőrzi.
|
||||||
|
3. **deploy** (csak ha a `DEPLOY_HOST` be van állítva): felmásolja a `docker-compose.yml`-t és a `Caddyfile`-t a szerverre, beírja az új `TAG`-et a szerveren lévő `.env`-be, majd `docker compose pull && up -d`. Az adatbázis-migrációk a backend indulásakor futnak le.
|
||||||
|
|
||||||
|
Kézzel is indítható a repó Actions oldaláról (workflow_dispatch).
|
||||||
|
|
||||||
|
## Runner (dev szerver)
|
||||||
|
|
||||||
|
A runner a `ci/runner` mappában van. A jobokat a gép Dockerén indítja, így az image-buildek a meglévő BuildKit cache-t használják. A tesztek cargo-cache-e a `sorsfonalak-ci-*` kötetekben marad meg.
|
||||||
|
|
||||||
|
1. Regisztrációs token: Gitea → repó → Beállítások → Actions → Runners → *Create new runner*.
|
||||||
|
2. Indítás:
|
||||||
|
```sh
|
||||||
|
cd ci/runner
|
||||||
|
GITEA_RUNNER_REGISTRATION_TOKEN=<token> docker compose up -d
|
||||||
|
```
|
||||||
|
A regisztráció a `runner-data` kötetbe kerül. A későbbi indításokhoz már nem kell token.
|
||||||
|
|
||||||
|
A jobok elérik a gép Docker-socketjét, ez root-jogot jelent a dev szerveren. A workflow csak a repóba pusholt commitokra fut, forkból érkező pull requestekre nem.
|
||||||
|
|
||||||
|
## Repó-beállítások
|
||||||
|
|
||||||
|
Gitea → repó → Beállítások → Actions:
|
||||||
|
|
||||||
|
| Név | Fajta | Érték |
|
||||||
|
|---|---|---|
|
||||||
|
| `REGISTRY_TOKEN` | secret | a `sagifer` fiók access tokenje, `write:package` jogosultsággal |
|
||||||
|
| `DEPLOY_SSH_KEY` | secret | a szerveren lévő deploy felhasználó privát kulcsa |
|
||||||
|
| `DEPLOY_HOST` | variable | `deploy@<szerver IP>` |
|
||||||
|
| `DEPLOY_KNOWN_HOSTS` | variable | az `ssh-keyscan <szerver IP>` kimenete |
|
||||||
|
| `DEPLOY_PATH` | variable | nem kötelező, alapértéke `/opt/sorsfonalak` |
|
||||||
|
|
||||||
|
## Szerver (egyszeri beállítás)
|
||||||
|
|
||||||
|
Egy friss Ubuntu dropleten, rootként:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Docker
|
||||||
|
curl -fsSL https://get.docker.com | sh
|
||||||
|
# 2 GB swap a 2 GB RAM mellé
|
||||||
|
fallocate -l 2G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile
|
||||||
|
echo '/swapfile none swap sw 0 0' >> /etc/fstab
|
||||||
|
# deploy felhasználó, aki dockert futtathat
|
||||||
|
adduser --disabled-password --gecos '' deploy && usermod -aG docker deploy
|
||||||
|
mkdir -p /home/deploy/.ssh && echo '<publikus kulcs>' > /home/deploy/.ssh/authorized_keys
|
||||||
|
chown -R deploy: /home/deploy/.ssh && chmod 700 /home/deploy/.ssh && chmod 600 /home/deploy/.ssh/authorized_keys
|
||||||
|
mkdir -p /opt/sorsfonalak && chown deploy: /opt/sorsfonalak
|
||||||
|
# tűzfal: SSH, HTTP, HTTPS
|
||||||
|
ufw allow OpenSSH && ufw allow 80,443/tcp && ufw allow 443/udp && ufw enable
|
||||||
|
```
|
||||||
|
|
||||||
|
`deploy` felhasználóként, a `/opt/sorsfonalak` mappában:
|
||||||
|
|
||||||
|
- `.env`: az itteni `.env.example` kitöltve.
|
||||||
|
- `.env.secrets`: `OPENROUTER_API_KEY=...`.
|
||||||
|
- `docker login registry.sagifer.com` egy `read:package` jogú tokennel. Amíg a `sagifer` fiók nyilvános, erre nincs szükség.
|
||||||
|
|
||||||
|
A domain DNS A rekordjai (`@` és `www`) még az első telepítés előtt mutassanak a szerverre, különben a Caddy nem kap tanúsítványt. A Google OAuth kliensnél a `https://<domain>` címet fel kell venni az engedélyezett JavaScript-források közé.
|
||||||
|
|
||||||
|
## Üzemeltetés
|
||||||
|
|
||||||
|
- Naplók: `docker compose logs -f backend worker`
|
||||||
|
- Visszaállás korábbi verzióra: `.env`-ben `TAG=<régebbi hash>`, utána `docker compose up -d`
|
||||||
|
- Mentés: naponta egy `pg_dump` a `/opt/sorsfonalak/backups` mappába, 14 napig megmarad. A mentéseket érdemes a szerverről is elvinni (DigitalOcean backup, vagy `rsync` otthonra).
|
||||||
|
- Visszatöltés: `gunzip -c backups/sorsfonalak-<dátum>.sql.gz | docker compose exec -T postgres psql -U sorsfonalak sorsfonalak`
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
# Production stack on the server (copied there by the CI deploy job).
|
||||||
|
#
|
||||||
|
# Needs next to it: .env (see .env.example) and .env.secrets
|
||||||
|
# (OPENROUTER_API_KEY). TAG in .env is set by every deployment.
|
||||||
|
|
||||||
|
x-logging: &logging
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "10m"
|
||||||
|
max-file: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
caddy:
|
||||||
|
image: caddy:2.11.9-alpine
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
- "443:443/udp"
|
||||||
|
environment:
|
||||||
|
DOMAIN: ${DOMAIN:?set DOMAIN in .env}
|
||||||
|
volumes:
|
||||||
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
|
- caddy-data:/data
|
||||||
|
- caddy-config:/config
|
||||||
|
depends_on:
|
||||||
|
- frontend
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
horoscope-api:
|
||||||
|
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-horoscope-api:${TAG:-latest}
|
||||||
|
read_only: true
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:18-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: sorsfonalak
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
|
||||||
|
POSTGRES_DB: sorsfonalak
|
||||||
|
volumes:
|
||||||
|
- pgdata:/var/lib/postgresql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U sorsfonalak -d sorsfonalak"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 10
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
# Daily compressed dump into ./backups, kept for 14 days.
|
||||||
|
backup:
|
||||||
|
image: postgres:18-alpine
|
||||||
|
environment:
|
||||||
|
PGHOST: postgres
|
||||||
|
PGUSER: sorsfonalak
|
||||||
|
PGPASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
PGDATABASE: sorsfonalak
|
||||||
|
volumes:
|
||||||
|
- ./backups:/backups
|
||||||
|
entrypoint: ["/bin/sh", "-c"]
|
||||||
|
command:
|
||||||
|
- |
|
||||||
|
while true; do
|
||||||
|
f=/backups/sorsfonalak-$$(date +%F).sql.gz
|
||||||
|
pg_dump --no-owner | gzip > "$$f.tmp" && mv "$$f.tmp" "$$f"
|
||||||
|
find /backups -name 'sorsfonalak-*.sql.gz' -mtime +14 -delete
|
||||||
|
sleep 86400
|
||||||
|
done
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
backend:
|
||||||
|
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-backend:${TAG:-latest}
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgres://sorsfonalak:${POSTGRES_PASSWORD}@postgres:5432/sorsfonalak
|
||||||
|
HOROSCOPE_API_URL: http://horoscope-api:8080
|
||||||
|
PUBLIC_BASE_URL: https://${DOMAIN}
|
||||||
|
GOOGLE_CLIENT_IDS: ${GOOGLE_CLIENT_IDS:-}
|
||||||
|
BOOTSTRAP_ADMIN_EMAILS: ${BOOTSTRAP_ADMIN_EMAILS:-}
|
||||||
|
ANALYSIS_MODEL: ${ANALYSIS_MODEL:-}
|
||||||
|
SUMMARY_MODEL: ${SUMMARY_MODEL:-}
|
||||||
|
PASSWORD_LOGIN: ${PASSWORD_LOGIN:-false}
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
horoscope-api:
|
||||||
|
condition: service_healthy
|
||||||
|
read_only: true
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
worker:
|
||||||
|
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-worker:${TAG:-latest}
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgres://sorsfonalak:${POSTGRES_PASSWORD}@postgres:5432/sorsfonalak
|
||||||
|
SMTP_URL: ${SMTP_URL:-}
|
||||||
|
MAIL_FROM: ${MAIL_FROM:-}
|
||||||
|
PUBLIC_BASE_URL: https://${DOMAIN}
|
||||||
|
env_file:
|
||||||
|
- path: .env.secrets
|
||||||
|
required: false
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
read_only: true
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-frontend:${TAG:-latest}
|
||||||
|
environment:
|
||||||
|
BACKEND_URL: http://backend:8081
|
||||||
|
HOROSCOPE_API_URL: http://horoscope-api:8080
|
||||||
|
depends_on:
|
||||||
|
backend:
|
||||||
|
condition: service_healthy
|
||||||
|
read_only: true
|
||||||
|
tmpfs:
|
||||||
|
- /app/.next/cache
|
||||||
|
- /tmp
|
||||||
|
logging: *logging
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
pgdata:
|
||||||
|
caddy-data:
|
||||||
|
caddy-config:
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.next
|
.next
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
|||||||
Reference in New Issue
Block a user