Files
ArkLinks/Dockerfile
2026-01-15 12:13:35 +02:00

42 lines
780 B
Docker

# Build stage
FROM node:20-alpine AS build
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Set environment variables for build
ENV VITE_APPWRITE_ENDPOINT=https://ds.nebulm.com/v1
ENV VITE_APPWRITE_PROJECT_ID=6967821e00334d7301a7
# Build the app
RUN npm run build
# Production stage - lightweight Node.js server
FROM node:20-alpine
WORKDIR /app
# Install serve globally
RUN npm install -g serve
# Copy built files from build stage
COPY --from=build /app/dist ./dist
# Run as non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001 -G nodejs && \
chown -R nodejs:nodejs /app
USER nodejs
# Start serve on port 3000
CMD ["serve", "-s", "dist", "-l", "3000"]