fix: added energy-management
This commit is contained in:
27
energy-management/Dockerfile
Normal file
27
energy-management/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM node:22-slim AS build
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /repo
|
||||
COPY package.json ./
|
||||
COPY backend/package.json backend/package.json
|
||||
COPY frontend/package.json frontend/package.json
|
||||
RUN npm install
|
||||
|
||||
COPY backend backend
|
||||
COPY frontend frontend
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-slim AS runtime
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=build /repo/package.json ./package.json
|
||||
COPY --from=build /repo/backend/package.json ./backend/package.json
|
||||
COPY --from=build /repo/node_modules ./node_modules
|
||||
COPY --from=build /repo/backend/node_modules ./backend/node_modules
|
||||
COPY --from=build /repo/backend/dist ./backend/dist
|
||||
COPY --from=build /repo/frontend/dist ./backend/dist/public
|
||||
|
||||
VOLUME ["/app/data"]
|
||||
EXPOSE 3000
|
||||
CMD ["node", "backend/dist/index.js"]
|
||||
Reference in New Issue
Block a user