From fd6603682ad7c32c58289c59d732c1389ee5ca6d Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Sat, 31 Oct 2026 21:39:11 -0400 Subject: [PATCH] Add Docker setup --- .dockerignore | 18 ++++++++++++++++++ Dockerfile | 27 +++++++++++++++++++++++++++ README.md | 8 ++++++++ docker-compose.yml | 11 +++++++++++ 4 files changed, 64 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c017004 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +node_modules +build +.svelte-kit +.git +.vscode +.env +.env.* +!.env.example +Dockerfile +docker-compose.yml +.dockerignore +PROJECT.md +Update.md +UPDATE.md +blogs +*.log +.DS_Store +Thumbs.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cb799e2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM oven/bun:1.4 AS build +WORKDIR /app + +COPY package.json bun.lock* ./ +RUN bun install + +COPY . . +RUN bun --bun vite build + +FROM oven/bun:1.4 AS runtime +WORKDIR /app + +RUN apt-get update \ + && apt-get install -y --no-install-recommends ffmpeg \ + && rm -rf /var/lib/apt/lists/* + +COPY package.json bun.lock* ./ +RUN bun install --production --ignore-scripts + +COPY --from=build /app/build ./build + +ENV NODE_ENV=production +ENV PORT=3000 +EXPOSE 3000 + +USER bun +CMD ["bun", "./build/index.js"] diff --git a/README.md b/README.md index fb51c79..e82a6f9 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,14 @@ bun run start The music player needs `ffmpeg` installed on the server. +### Docker + +```bash +docker compose up -d --build +``` + +The image builds the site with Bun and includes `ffmpeg`. It reads `.env` and serves on port 3000; set `HOST_PORT` to publish it on a different port. + ## Configuration Copy `.env.example` to `.env` and fill in what you need. Every value is optional. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f4e38c6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + website: + build: . + container_name: sirblob-website + restart: unless-stopped + env_file: + - .env + environment: + PORT: 3000 + ports: + - "${HOST_PORT:-3000}:3000"