Files
Simon Malm 82394e9a94
Some checks failed
CI / test (20) (push) Failing after 16s
CI / test (22) (push) Failing after 20s
CI / security (push) Failing after 2m8s
CI / build (push) Has been skipped
Deploy / build-and-deploy (push) Failing after 43s
Deploy / docker-build (push) Failing after 9s
Gitea CI / test (push) Failing after 13s
Gitea CI / docker-build (push) Has been skipped
feat: first
2025-08-13 20:18:21 +02:00

37 lines
680 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json bun.lock* ./
# Install dependencies (try bun first, fallback to npm)
RUN if [ -f bun.lock ]; then \
npm install -g bun && bun install; \
else npm ci; \
fi
# Copy source code
COPY . .
# Build the application
RUN if [ -f bun.lock ]; then \
bun run build; \
else npm run build; \
fi
# Production stage
FROM nginx:alpine
# Copy built files from builder stage
COPY --from=builder /app/build /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]