From a27af9aefb742125221d5a06a03c1b374816fd87 Mon Sep 17 00:00:00 2001 From: webfussel Date: Tue, 15 Jul 2025 08:22:48 +0200 Subject: [PATCH] add: compose file docker compose file --- docker-compose.yaml | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..92f7821 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,47 @@ +version: '3' + +services: + propapier: + image: oven/bun:latest + container_name: propapier + working_dir: /app + ports: + - "1338:3000" + volumes: + - propapier_data:/app + environment: + - NODE_ENV=production + command: > + sh -c " + # Install git and curl if not already installed + if ! command -v git &> /dev/null || ! command -v curl &> /dev/null; then + echo 'Installing required packages...' + apt-get update && apt-get install -y git curl + fi && + + # Clone repository if not already cloned + if [ ! -d /app/.git ]; then + echo 'Cloning repository...' + git clone https://git.webfussel.de/webfussel/propapier /tmp/propapier && + cp -r /tmp/propapier/. /app/ && + rm -rf /tmp/propapier + fi && + + # Install dependencies and start application + echo 'Installing dependencies...' && + bun install && + echo 'Building application...' && + bun run build && + echo 'Starting application...' && + bun .output/server/index.mjs + " + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:1338"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + +volumes: + propapier_data: