Updated dockerfile for new file structure

This commit is contained in:
Karmaa
2025-02-09 01:55:36 -06:00
parent e058892118
commit d799b8fe42

View File

@@ -1,30 +1,30 @@
# Build frontend
FROM node:18-alpine AS frontend-build
WORKDIR /app
COPY frontend/package*.json ./frontend/
RUN npm --prefix frontend install
COPY frontend/ ./frontend/
RUN npm --prefix frontend run build
COPY package*.json ./
RUN npm install
COPY ./ ./
RUN npm run build
# Build backend
FROM node:18-alpine AS backend-build
WORKDIR /backend
COPY backend/package*.json ./
COPY package*.json ./
RUN npm install
COPY backend/ .
COPY src/backend src/backend
# Configure nginx
FROM nginx:alpine
RUN apk add --no-cache nodejs npm
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html
COPY --from=backend-build src/backend/ /src/backend/
COPY --from=backend-build src/backend/entrypoint.sh /src/backend/entrypoint.sh
COPY --from=frontend-build /app/dist /usr/share/nginx/html
COPY --from=backend-build /backend /backend
COPY --from=backend-build /backend/entrypoint.sh /backend/entrypoint.sh
# Configure start-up
RUN chmod +x /backend/entrypoint.sh
ENTRYPOINT ["/src/backend/entrypoint.sh"]
ENTRYPOINT ["/backend/entrypoint.sh"]
EXPOSE 8080
EXPOSE 8081