podman -> docker
Some checks failed
CI / Check Style (push) Has been cancelled
CI / Run Clippy (push) Has been cancelled
CI / Run Tests (push) Has been cancelled

This commit is contained in:
Priec
2026-06-30 00:49:25 +02:00
parent 602d671996
commit 9d2368ee08
6 changed files with 26 additions and 35 deletions

View File

@@ -1,8 +1,8 @@
http://{$APP_DOMAIN:eshop.kompress.farmeris.sk} { # Caddyfile_kompress_eshop — imported by the central Caddy
redir https://{$APP_DOMAIN:eshop.kompress.farmeris.sk}{uri} permanent # (docker-compose.caddy.yml). Caddy reaches the app by container name because
} # it shares the external `kompress_eshop-net` network, same as gitea/biomed.
# Caddy serves automatic HTTPS and redirects http->https by default.
https://{$APP_DOMAIN:eshop.kompress.farmeris.sk} { eshop.kompress.farmeris.sk {
encode zstd gzip encode zstd gzip
header { header {

2
Cargo.lock generated
View File

@@ -2640,7 +2640,7 @@ dependencies = [
[[package]] [[package]]
name = "kompress_eshop" name = "kompress_eshop"
version = "0.1.0" version = "0.5.0"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum", "axum",

View File

@@ -1,4 +1,4 @@
COMPOSE ?= podman compose -f podman-compose.prod.yml --env-file .env.production COMPOSE ?= docker compose -f docker-compose.prod.yml --env-file .env.production
# --- Frontend (Tailwind v4 + PenguinUI) ----------------------------- # --- Frontend (Tailwind v4 + PenguinUI) -----------------------------
# Uses the Tailwind v4 standalone binary (no Node required at runtime). # Uses the Tailwind v4 standalone binary (no Node required at runtime).

View File

@@ -52,7 +52,7 @@ listening on http://localhost:5150
You can check your [configuration](config/development.yaml) to pick either frontend setup or server-side rendered template, and activate the relevant configuration sections. You can check your [configuration](config/development.yaml) to pick either frontend setup or server-side rendered template, and activate the relevant configuration sections.
## Production Podman Deploy ## Production Docker Deploy
Create the production environment file: Create the production environment file:
@@ -60,13 +60,22 @@ Create the production environment file:
cp .env.production.example .env.production cp .env.production.example .env.production
``` ```
Edit `.env.production` and set real secrets for `POSTGRES_PASSWORD`, `JWT_SECRET`, `OAUTH_PRIVATE_KEY`, and the OAuth client values. Then start the production stack: Edit `.env.production` and set real secrets for `POSTGRES_PASSWORD`, `JWT_SECRET`, `OAUTH_PRIVATE_KEY`, and the OAuth client values. Create the shared network once (the central Caddy joins it too):
```sh
docker network create kompress_eshop-net
```
Then start the production stack:
```sh ```sh
make up make up
``` ```
The production Podman stack runs Caddy, the Loco app, and Postgres. Caddy publishes ports `80` and `443`; the app port `5150` stays private on the container network. HTTP requests on port `80` are redirected to HTTPS on port `443`. The stack runs the Loco app + Postgres only — TLS/routing is handled by the
central Caddy (`docker-compose.caddy.yml`), which shares the external
`kompress_eshop-net` network and reaches the app as `kompress:5150` via the
imported `Caddyfile`. The app port `5150` is never published to the host.
## Getting help ## Getting help

View File

@@ -1,27 +1,9 @@
services: services:
caddy:
image: docker.io/library/caddy:2-alpine
container_name: kompress-caddy
env_file:
- .env.production
ports:
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
networks:
- kompress_eshop-net
restart: unless-stopped
depends_on:
- kompress
kompress: kompress:
container_name: kompress container_name: kompress
build: build:
context: . context: .
dockerfile: Podmanfile dockerfile: Dockerfile
env_file: env_file:
- .env.production - .env.production
environment: environment:
@@ -42,7 +24,7 @@ services:
start_period: 20s start_period: 20s
postgres: postgres:
image: docker.io/library/postgres:16-alpine image: postgres:16-alpine
container_name: kompress-postgres container_name: kompress-postgres
env_file: env_file:
- .env.production - .env.production
@@ -61,16 +43,16 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
# External network shared with the central Caddy (docker-compose.caddy.yml).
# Create it once on the host: docker network create kompress_eshop-net
# Then add it to the caddy service's `networks:` list so Caddy can reach
# `kompress:5150` by container name — exactly like gitea-net etc.
networks: networks:
kompress_eshop-net: kompress_eshop-net:
name: kompress_eshop-net external: true
volumes: volumes:
kompress_eshop_data: kompress_eshop_data:
name: kompress_eshop_data name: kompress_eshop_data
postgres_data: postgres_data:
name: kompress_postgres_data name: kompress_postgres_data
caddy_data:
name: kompress_caddy_data
caddy_config:
name: kompress_caddy_config