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:
parent
f8abfee1dc
commit
d69d826586
@ -11,3 +11,6 @@
|
||||
!README.md
|
||||
!frontend
|
||||
frontend/node_modules
|
||||
!.yarn/**
|
||||
!.yarnrc.yml
|
||||
!frontend/.yarn/**
|
||||
|
@ -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.
@ -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",
|
||||
|
4
scripts/build-frontend-if-needed.sh
Executable file
4
scripts/build-frontend-if-needed.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
if [ ! -d ./frontend/build ]; then
|
||||
yarn --cwd ./frontend install --immutable && yarn build:frontend;
|
||||
fi
|
Loading…
Reference in New Issue
Block a user