mirror of
https://github.com/SirBlobby/Hoya26.git
synced 2026-02-04 03:34:34 -05:00
Docker Update and Fixes
This commit is contained in:
41
frontend/Dockerfile
Normal file
41
frontend/Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the SvelteKit app
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine AS production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json for production dependencies
|
||||
COPY package.json ./
|
||||
|
||||
# Install only production dependencies
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# Copy built files from builder
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY --from=builder /app/server ./server
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Set environment variables
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
|
||||
# Start the server
|
||||
CMD ["node", "server/index.js"]
|
||||
Reference in New Issue
Block a user