Add deployment scripts

This commit is contained in:
2025-06-14 18:31:24 +02:00
parent 031b139657
commit e7b8fe337a
4 changed files with 69 additions and 0 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM oven/bun:1.0.25-slim as builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY bun.lockb ./
# Install dependencies
RUN bun install
# Copy source files
COPY . .
# Build the application
RUN bun run build
# Production stage
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

16
deploy.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -e
# Build the application
echo "Building the application..."
bun run build
# Get the tag or use latest
TAG=$(git describe --tags --exact-match 2>/dev/null || echo "latest")
echo "Building docker image with tag: $TAG"
# Build and push the Docker image
docker build -t docker.site.quack-lab.dev/signaturer:$TAG .
docker push docker.site.quack-lab.dev/signaturer:$TAG
echo "Deployment completed successfully!"

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
version: '3.8'
services:
app:
image: docker.site.quack-lab.dev/signaturer:latest
ports:
- "80:80"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3

17
nginx.conf Normal file
View File

@@ -0,0 +1,17 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Support for Single Page Application routing
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location /assets {
expires 1y;
add_header Cache-Control "public, no-transform";
}
}