Compare commits

...

1 Commits

Author SHA1 Message Date
cmcooper1980
c3eb1f0024 Build frontend during docker build (#894)
Co-authored-by: Jamie Scott <jamie@jami.org.uk>
2025-12-08 22:40:03 -06:00
3 changed files with 20 additions and 6 deletions

View File

@@ -9,9 +9,9 @@ tmp
# Docker extra
docker
frontend
.editorconfig
.eslintrc.cjs
.git
.gitignore
README.md
.github
*.md

View File

@@ -1,6 +1,9 @@
services:
dockge:
image: louislam/dockge:1
build:
context: .
dockerfile: docker/Dockerfile
restart: unless-stopped
ports:
# Host Port : Container Port

View File

@@ -4,9 +4,19 @@
FROM louislam/dockge:build-healthcheck AS build_healthcheck
############################################
# Build
# Build frontend
############################################
FROM louislam/dockge:base AS build
FROM louislam/dockge:base AS build_frontend
WORKDIR /app
COPY --chown=node:node . .
RUN --mount=type=cache,id=npm,target=/npm/store \
npm install && \
npm run build:frontend
############################################
# Install node modules
############################################
FROM louislam/dockge:base AS build_nodemodules
WORKDIR /app
COPY --chown=node:node ./package.json ./package.json
COPY --chown=node:node ./package-lock.json ./package-lock.json
@@ -18,7 +28,8 @@ RUN npm ci --omit=dev
FROM louislam/dockge:base AS release
WORKDIR /app
COPY --chown=node:node --from=build_healthcheck /app/extra/healthcheck /app/extra/healthcheck
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build_frontend /app/frontend-dist /app/frontend-dist
COPY --from=build_nodemodules /app/node_modules /app/node_modules
COPY --chown=node:node . .
RUN mkdir ./data