0
Fork 0
mirror of https://github.com/stonith404/pingvin-share.git synced 2025-01-15 01:14:27 -05:00
pingvin-share/Dockerfile

34 lines
1.1 KiB
Text
Raw Normal View History

2022-12-08 17:21:31 -05:00
FROM node:18-slim AS frontend-builder
WORKDIR /opt/app
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY ./frontend .
RUN npm run build
2022-12-08 17:21:31 -05:00
FROM node:18-slim AS backend-builder
RUN apt-get update && apt-get install -y openssl
WORKDIR /opt/app
COPY backend/package.json backend/package-lock.json ./
RUN npm ci
COPY ./backend .
RUN npx prisma generate
RUN npm run build
2022-12-08 17:21:31 -05:00
FROM node:18-slim AS runner
ENV NODE_ENV=production
2022-12-08 17:21:31 -05:00
RUN apt-get update && apt-get install -y openssl
WORKDIR /opt/app/frontend
COPY --from=frontend-builder /opt/app/next.config.js .
COPY --from=frontend-builder /opt/app/public ./public
COPY --from=frontend-builder /opt/app/.next ./.next
COPY --from=frontend-builder /opt/app/node_modules ./node_modules
WORKDIR /opt/app/backend
COPY --from=backend-builder /opt/app/node_modules ./node_modules
COPY --from=backend-builder /opt/app/dist ./dist
COPY --from=backend-builder /opt/app/prisma ./prisma
COPY --from=backend-builder /opt/app/package.json ./
2022-12-08 17:21:31 -05:00
WORKDIR /opt/app
EXPOSE 3000
2022-12-02 09:10:49 -05:00
CMD cd frontend && node_modules/.bin/next start & cd backend && npm run prod