mirror of
https://github.com/philipredstone/relnet.git
synced 2025-07-09 15:16:41 +02:00
Update Dockerfile; fix index.html and add build scripts
This commit is contained in:
39
Dockerfile
39
Dockerfile
@ -1,8 +1,41 @@
|
||||
FROM node:18 as builder
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM node:22 AS frontend-builder
|
||||
|
||||
# Workingdir
|
||||
WORKDIR /frontend
|
||||
|
||||
# Copy files
|
||||
COPY frontend/src/ src/
|
||||
COPY frontend/package.json .
|
||||
COPY frontend/index.html .
|
||||
COPY frontend/tsconfig.json .
|
||||
COPY frontend/vite.config.js .
|
||||
|
||||
# Install libs
|
||||
RUN yarn install
|
||||
# Build to dist/
|
||||
RUN yarn build
|
||||
|
||||
|
||||
FROM node:22 AS backend-builder
|
||||
|
||||
# Workingdir
|
||||
WORKDIR /app
|
||||
COPY package.json /app
|
||||
|
||||
RUN yarn
|
||||
COPY package.json .
|
||||
RUN yarn install
|
||||
|
||||
COPY tsconfig.json .
|
||||
COPY src/ src/
|
||||
|
||||
# Build to dist/
|
||||
RUN yarn run build
|
||||
|
||||
|
||||
# Final stage
|
||||
FROM node:22
|
||||
COPY --from=frontend-builder /frontend/dist/ /app/frontend/dist
|
||||
COPY --from=backend-builder /app/dist /app/dist
|
||||
COPY package.json .
|
||||
|
||||
CMD ["yarn", "run", "start"]
|
||||
|
Reference in New Issue
Block a user