FE-0: Projektgrundgerüst (SvelteKit, Tailwind, Docker, Caddy)
This commit is contained in:
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
# Build stage
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package.json .
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM node:22-alpine AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY package.json package.json
|
||||
|
||||
# Non-root user
|
||||
RUN addgroup -S nsct && adduser -S nsct -G nsct
|
||||
USER nsct
|
||||
|
||||
EXPOSE 3000
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["node", "build"]
|
||||
Reference in New Issue
Block a user