[FEAT] Add docker files
This commit is contained in:
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
# Build stage
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json package-lock.json* ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy source files
|
||||
COPY . .
|
||||
|
||||
# Build the app
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM caddy:2-alpine
|
||||
|
||||
# Create log directory
|
||||
RUN mkdir -p /var/log/caddy
|
||||
|
||||
# Copy built files
|
||||
COPY --from=builder /app/dist /srv/dist
|
||||
|
||||
# Copy Caddy configuration
|
||||
COPY Caddyfile.docker /etc/caddy/Caddyfile
|
||||
|
||||
EXPOSE 1337
|
||||
|
||||
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]
|
||||
Reference in New Issue
Block a user