1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: Tweak docker build

This commit is contained in:
Christopher Kolstad 2024-06-07 15:00:02 +02:00
parent f8abfee1dc
commit d69d826586
No known key found for this signature in database
GPG Key ID: D9041DC670F032F3
5 changed files with 10 additions and 3 deletions

View File

@ -11,3 +11,6 @@
!README.md
!frontend
frontend/node_modules
!.yarn/**
!.yarnrc.yml
!frontend/.yarn/**

View File

@ -11,13 +11,13 @@ RUN corepack enable
RUN yarn install --immutable && yarn prepare:backend && yarn local:package
# frontend/build should already exist (it needs to be built in the local filesystem but in case of a fresh build we'll build it here)
RUN yarn build:frontend
RUN yarn build:frontend:if-needed
RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build
WORKDIR /unleash/docker
RUN yarn install
RUN yarn workspaces focus -A --production
FROM node:$NODE_VERSION

Binary file not shown.

View File

@ -36,7 +36,7 @@
"copy-templates": "copyfiles -u 1 src/mailtemplates/**/*.mustache dist/",
"build:backend": "tsc --pretty --strictNullChecks false",
"build:frontend": "yarn --cwd ./frontend run build",
"build:frontend:if-needed": "if [ ! -d ./frontend/build ]; then yarn install --cwd ./frontend --frozen-lockfile && yarn build:frontend; fi",
"build:frontend:if-needed": "./scripts/build-frontend-if-needed.sh",
"build": "yarn run clean && concurrently \"yarn:copy-templates\" \"yarn:build:frontend\" \"yarn:build:backend\"",
"dev:backend": "TZ=UTC NODE_ENV=development tsc-watch --strictNullChecks false --onSuccess \"node dist/server-dev.js\"",
"dev:frontend": "wait-on tcp:4242 && yarn --cwd ./frontend run dev",

View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
if [ ! -d ./frontend/build ]; then
yarn --cwd ./frontend install --immutable && yarn build:frontend;
fi