build: switch frontend and worker to Dockerfile images
This commit is contained in:
9
Frontend/.dockerignore
Normal file
9
Frontend/.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
||||
.git
|
||||
.gitignore
|
||||
node_modules
|
||||
.nuxt
|
||||
.output
|
||||
.data
|
||||
npm-debug.log*
|
||||
dist
|
||||
coverage
|
||||
20
Frontend/Dockerfile
Normal file
20
Frontend/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM node:22-bookworm-slim
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --legacy-peer-deps
|
||||
|
||||
COPY . .
|
||||
|
||||
# Build server bundle at image build time.
|
||||
RUN npx prisma generate && npm run build
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NITRO_HOST=0.0.0.0
|
||||
ENV NITRO_PORT=3000
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Keep schema in sync, then start Nitro production server.
|
||||
CMD ["bash", "-lc", "npx prisma db push && node .output/server/index.mjs"]
|
||||
15
Frontend/Dockerfile.worker
Normal file
15
Frontend/Dockerfile.worker
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM node:22-bookworm-slim
|
||||
|
||||
WORKDIR /app/delivery
|
||||
|
||||
COPY package*.json ./
|
||||
# Worker does not need Nuxt postinstall hooks.
|
||||
RUN npm install --ignore-scripts --legacy-peer-deps
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npx prisma generate
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
CMD ["npm", "run", "worker:delivery"]
|
||||
Reference in New Issue
Block a user