prod setup
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:
2026-05-20 11:01:23 +00:00
parent f92cb1f134
commit 8f89423994
4 changed files with 20 additions and 25 deletions

View File

@@ -1,17 +1,12 @@
# Reverse-proxy config for temp.sk.
#
# This file is intended to be imported by the central Caddyfile on the server.
# Caddy provisions and renews the HTTPS certificate automatically.
gitara.farmeris.sk { gitara.farmeris.sk {
encode gzip encode gzip
@static path /static/* @static path /static/*
header @static Cache-Control "public, max-age=2592000" header @static Cache-Control "public, max-age=2592000"
reverse_proxy universal-web:5150 reverse_proxy gitara-web:5150
} }
www.gitara.farmeris.sk { www.gitara.farmeris.sk {
redir https://temp.sk{uri} permanent redir https://gitara.farmeris.sk{uri} permanent
} }

View File

@@ -1,11 +1,11 @@
[workspace] [workspace]
[package] [package]
name = "universal_web" name = "gitara_web"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false publish = false
default-run = "universal_web-cli" default-run = "gitara_web-cli"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -45,7 +45,7 @@ axum-extra = { version = "0.10", features = ["form"] }
bytes = { version = "1" } bytes = { version = "1" }
[[bin]] [[bin]]
name = "universal_web-cli" name = "gitara_web-cli"
path = "src/bin/main.rs" path = "src/bin/main.rs"
required-features = [] required-features = []

View File

@@ -1,10 +1,11 @@
FROM rust:1.87.0-slim-bookworm AS builder FROM rust:1-slim-bookworm AS builder
WORKDIR /usr/src WORKDIR /usr/src
COPY . . COPY . .
RUN cargo build --release --bin universal_web-cli RUN cargo build --release --bin gitara_web-cli
FROM debian:bookworm-slim FROM debian:bookworm-slim
@@ -16,9 +17,9 @@ WORKDIR /usr/app
COPY --from=builder /usr/src/assets assets COPY --from=builder /usr/src/assets assets
COPY --from=builder /usr/src/config config COPY --from=builder /usr/src/config config
COPY --from=builder /usr/src/target/release/universal_web-cli universal_web-cli COPY --from=builder /usr/src/target/release/gitara_web-cli gitara_web-cli
ENV LOCO_ENV=production ENV LOCO_ENV=production
EXPOSE 5150 EXPOSE 5150
ENTRYPOINT ["/usr/app/universal_web-cli"] ENTRYPOINT ["/usr/app/gitara_web-cli"]
CMD ["start"] CMD ["start"]

View File

@@ -1,28 +1,27 @@
services: services:
universal-web: universal-web:
container_name: ${CONTAINER_NAME:?set CONTAINER_NAME} container_name: gitara-web
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
env_file: env_file:
- .env.production - .env.production
volumes: volumes:
- universal_web_uploads:/usr/app/data/uploads - gitara_web_data:/usr/app/data
networks: networks:
- reverse-proxy - gitara-net
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:$${PORT:-5150}/_ping"] test: ["CMD-SHELL", "curl -fsS http://localhost:5150/_ping"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3
start_period: 20s start_period: 20s
networks: networks:
reverse-proxy: gitara-net:
external: true external: true
name: ${REVERSE_PROXY_NETWORK:?set REVERSE_PROXY_NETWORK}
volumes: volumes:
universal_web_uploads: gitara_web_data:
name: ${UPLOADS_VOLUME_NAME:?set UPLOADS_VOLUME_NAME} name: gitara_web_data