Implement persistent backend with Docker storage, photo uploads, and real-time SSE sync
This commit is contained in:
1 parent
157fc83a47
commit
7f4fed3c8c
10 files changed
+1583
-75
No files matched your search
+21
-5
@@ -10,14 +10,30 @@ COPY . ./
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
FROM node:22-alpine
|
||||
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=80
|
||||
ENV DATA_DIR=/app/data
|
||||
|
||||
# Install production dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# Copy backend server code
|
||||
COPY server/ ./server/
|
||||
|
||||
# Copy built frontend assets
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Create persistent storage directories
|
||||
RUN mkdir -p /app/data/uploads
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=5s --retries=3 \
|
||||
CMD wget --quiet --tries=1 --spider http://127.0.0.1:80/ || exit 1
|
||||
CMD wget --quiet --tries=1 --spider http://127.0.0.1:80/api/health || exit 1
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
CMD ["node", "server/index.js"]
|
||||
Reference in new issue
Block a user