eindelijk weer eens een push
This commit is contained in:
1 parent
01cff8e165
commit
ff21c258e0
2747 files changed
+302316
-131101
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# chat/Dockerfile
|
||||
# Stage 1: build frontend
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# copy frontend
|
||||
COPY chat-frontend/ ./chat-frontend/
|
||||
|
||||
WORKDIR /app/chat-frontend
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: backend + serve frontend
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built frontend
|
||||
COPY --from=build /app/chat-frontend/dist ./frontend
|
||||
|
||||
# Copy backend
|
||||
COPY chat-backend/package*.json ./chat-backend/
|
||||
COPY chat-backend/server.js ./chat-backend/
|
||||
|
||||
WORKDIR /app/chat-backend
|
||||
RUN npm install
|
||||
|
||||
# Expose backend WebSocket port and static frontend
|
||||
EXPOSE 3000
|
||||
|
||||
# Start both backend and frontend
|
||||
# Using simple Node backend and serve frontend via a tiny static server
|
||||
RUN npm install -g serve
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
Reference in new issue
Block a user