podman -> docker
This commit is contained in:
10
Caddyfile
10
Caddyfile
@@ -1,8 +1,8 @@
|
||||
http://{$APP_DOMAIN:eshop.kompress.farmeris.sk} {
|
||||
redir https://{$APP_DOMAIN:eshop.kompress.farmeris.sk}{uri} permanent
|
||||
}
|
||||
|
||||
https://{$APP_DOMAIN:eshop.kompress.farmeris.sk} {
|
||||
# Caddyfile_kompress_eshop — imported by the central Caddy
|
||||
# (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.
|
||||
eshop.kompress.farmeris.sk {
|
||||
encode zstd gzip
|
||||
|
||||
header {
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2640,7 +2640,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kompress_eshop"
|
||||
version = "0.1.0"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"axum",
|
||||
|
||||
2
Makefile
2
Makefile
@@ -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) -----------------------------
|
||||
# Uses the Tailwind v4 standalone binary (no Node required at runtime).
|
||||
|
||||
15
README.md
15
README.md
@@ -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.
|
||||
|
||||
## Production Podman Deploy
|
||||
## Production Docker Deploy
|
||||
|
||||
Create the production environment file:
|
||||
|
||||
@@ -60,13 +60,22 @@ Create the production environment file:
|
||||
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
|
||||
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
|
||||
|
||||
@@ -1,27 +1,9 @@
|
||||
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:
|
||||
container_name: kompress
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Podmanfile
|
||||
dockerfile: Dockerfile
|
||||
env_file:
|
||||
- .env.production
|
||||
environment:
|
||||
@@ -42,7 +24,7 @@ services:
|
||||
start_period: 20s
|
||||
|
||||
postgres:
|
||||
image: docker.io/library/postgres:16-alpine
|
||||
image: postgres:16-alpine
|
||||
container_name: kompress-postgres
|
||||
env_file:
|
||||
- .env.production
|
||||
@@ -61,16 +43,16 @@ services:
|
||||
timeout: 5s
|
||||
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:
|
||||
kompress_eshop-net:
|
||||
name: kompress_eshop-net
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
kompress_eshop_data:
|
||||
name: kompress_eshop_data
|
||||
postgres_data:
|
||||
name: kompress_postgres_data
|
||||
caddy_data:
|
||||
name: kompress_caddy_data
|
||||
caddy_config:
|
||||
name: kompress_caddy_config
|
||||
Reference in New Issue
Block a user