first commit
This commit is contained in:
38
Dockerfile
Normal file
38
Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
# Build Frontend
|
||||
FROM node:22-alpine as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
# Build-time variables
|
||||
ARG VITE_ADMIN_PIN
|
||||
ENV VITE_ADMIN_PIN=$VITE_ADMIN_PIN
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# Production Server (Node.js)
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install only production dependencies for the server
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# Copy built frontend
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
# Copy backend source
|
||||
COPY server.js .
|
||||
|
||||
# Create storage directories
|
||||
RUN mkdir -p uploads data
|
||||
|
||||
ENV PORT=8080
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user