Add Docker setup
This commit is contained in:
1 parent
7c8c9f329f
commit
fd6603682a
4 files changed
+64
No files matched your search
@@ -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
|
||||||
+27
@@ -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"]
|
||||||
@@ -76,6 +76,14 @@ bun run start
|
|||||||
|
|
||||||
The music player needs `ffmpeg` installed on the server.
|
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
|
## Configuration
|
||||||
|
|
||||||
Copy `.env.example` to `.env` and fill in what you need. Every value is optional.
|
Copy `.env.example` to `.env` and fill in what you need. Every value is optional.
|
||||||
|
|||||||
@@ -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"
|
||||||
Reference in new issue
Block a user