You've already forked isop-mirror
feat: setup Dockerfile for frontend
This commit is contained in:
8
frontend/.dockerignore
Normal file
8
frontend/.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.nuxt/
|
||||||
|
.output/
|
||||||
|
.env*
|
||||||
|
node_modules/
|
||||||
|
cypress/
|
||||||
|
cypress.config.ts
|
||||||
|
package-lock.json
|
||||||
|
*.md
|
||||||
37
frontend/Dockerfile
Normal file
37
frontend/Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Build Stage 1
|
||||||
|
|
||||||
|
FROM node:22-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
|
# Copy package.json and your lockfile
|
||||||
|
COPY package.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pnpm i
|
||||||
|
|
||||||
|
# Copy the entire project
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
# Prepare Nuxt (generates .nuxt with type definitions and auto-imports)
|
||||||
|
RUN pnpm run postinstall
|
||||||
|
|
||||||
|
# Build the project
|
||||||
|
RUN pnpm run build
|
||||||
|
|
||||||
|
# Build Stage 2
|
||||||
|
|
||||||
|
FROM node:22-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Only `.output` folder is needed from the build stage
|
||||||
|
COPY --from=build /app/.output/ ./
|
||||||
|
|
||||||
|
# Change the port and host
|
||||||
|
ENV PORT=80
|
||||||
|
ENV HOST=0.0.0.0
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
CMD ["node", "/app/server/index.mjs"]
|
||||||
Reference in New Issue
Block a user