Docker: Upgrade NPM before starting production build

This commit is contained in:
Michael Mayer 2022-02-09 19:31:57 +01:00
parent 628147a881
commit ef5c7a30ad
3 changed files with 9 additions and 9 deletions

View File

@ -42,14 +42,10 @@ fmt: fmt-js fmt-go
upgrade: dep-upgrade-js dep-upgrade
clean-local: clean-local-config clean-local-cache
clean-install: clean-local dep build-js install-bin install-assets
dev: dev-npm dev-go-amd64
dev-npm:
$(info Upgrading NPM in local dev environment...)
dev: npm install-go-amd64
npm:
$(info Upgrading NPM version...)
sudo npm update -g npm
dev-go-amd64:
$(info Installing Go in local AMD64 dev environment...)
sudo docker/scripts/install-go.sh amd64
go build -v ./...
acceptance-restart:
cp -f storage/acceptance/backup.db storage/acceptance/index.db
cp -f storage/acceptance/config/settingsBackup.yml storage/acceptance/config/settings.yml
@ -87,6 +83,10 @@ generate:
@if [ ${$(shell git diff --shortstat assets/locales/messages.pot):1:45} == $(POT_UNCHANGED) ]; then\
git checkout -- assets/locales/messages.pot;\
fi
install-go-amd64:
$(info Installing Go (AMD64)...)
sudo docker/scripts/install-go.sh amd64
go build -v ./...
install-bin:
scripts/build.sh prod ~/.local/bin/$(BINARY_NAME)
install-assets:

View File

@ -12,7 +12,7 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
COPY . .
# Build frontend and backend
RUN make dep build-js install
RUN make npm dep build-js install
################################################## PRODUCTION STAGE ####################################################
FROM ubuntu:21.10

View File

@ -12,7 +12,7 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
COPY . .
# Build frontend and backend
RUN make dep build-js install
RUN make npm dep build-js install
################################################## PRODUCTION STAGE ####################################################
FROM ubuntu:21.10