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 {
encode gzip
@static path /static/*
header @static Cache-Control "public, max-age=2592000"
reverse_proxy universal-web:5150
reverse_proxy gitara-web:5150
}
www.gitara.farmeris.sk {
redir https://temp.sk{uri} permanent
redir https://gitara.farmeris.sk{uri} permanent
}

View File

@@ -1,11 +1,11 @@
[workspace]
[package]
name = "universal_web"
name = "gitara_web"
version = "0.1.0"
edition = "2021"
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
@@ -45,7 +45,7 @@ axum-extra = { version = "0.10", features = ["form"] }
bytes = { version = "1" }
[[bin]]
name = "universal_web-cli"
name = "gitara_web-cli"
path = "src/bin/main.rs"
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
COPY . .
RUN cargo build --release --bin universal_web-cli
RUN cargo build --release --bin gitara_web-cli
FROM debian:bookworm-slim
@@ -16,9 +17,9 @@ WORKDIR /usr/app
COPY --from=builder /usr/src/assets assets
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
EXPOSE 5150
ENTRYPOINT ["/usr/app/universal_web-cli"]
ENTRYPOINT ["/usr/app/gitara_web-cli"]
CMD ["start"]

View File

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