forked from mirror/pixelfed
fix hadolint?
This commit is contained in:
parent
ad309ef523
commit
9d9a4cbe20
1 changed files with 10 additions and 8 deletions
18
Dockerfile
18
Dockerfile
|
@ -196,16 +196,16 @@ ENV NODE_ENV=$NODE_ENV
|
||||||
|
|
||||||
WORKDIR /var/www/
|
WORKDIR /var/www/
|
||||||
|
|
||||||
|
SHELL [ "bash", "-c" ]
|
||||||
|
|
||||||
# Install NPM dependencies
|
# Install NPM dependencies
|
||||||
RUN --mount=type=cache,id=pixelfed-node-${BUILDARCH},sharing=locked,target=/tmp/cache \
|
RUN --mount=type=cache,id=pixelfed-node-${BUILDARCH},sharing=locked,target=/tmp/cache \
|
||||||
--mount=type=bind,source=package.json,target=/var/www/package.json \
|
--mount=type=bind,source=package.json,target=/var/www/package.json \
|
||||||
--mount=type=bind,source=package-lock.json,target=/var/www/package-lock.json \
|
--mount=type=bind,source=package-lock.json,target=/var/www/package-lock.json \
|
||||||
<<EOF bash
|
<<EOF
|
||||||
if [[ $BUILD_FRONTEND -eq 1 ]]; then
|
if [[ $BUILD_FRONTEND -eq 1 ]];
|
||||||
npm install \
|
then
|
||||||
--cache /tmp/cache \
|
npm install --cache /tmp/cache --no-save --dev
|
||||||
--no-save \
|
|
||||||
--dev
|
|
||||||
else
|
else
|
||||||
echo "Skipping [npm install] as --build-arg [BUILD_FRONTEND] is not set to '1'"
|
echo "Skipping [npm install] as --build-arg [BUILD_FRONTEND] is not set to '1'"
|
||||||
fi
|
fi
|
||||||
|
@ -215,8 +215,10 @@ EOF
|
||||||
COPY --chown=${RUNTIME_UID}:${RUNTIME_GID} . /var/www
|
COPY --chown=${RUNTIME_UID}:${RUNTIME_GID} . /var/www
|
||||||
|
|
||||||
# Build the frontend with "mix" (See package.json)
|
# Build the frontend with "mix" (See package.json)
|
||||||
RUN <<EOF bash
|
RUN \
|
||||||
if [[ $BUILD_FRONTEND -eq 1 ]]; then
|
<<EOF
|
||||||
|
if [[ $BUILD_FRONTEND -eq 1 ]];
|
||||||
|
then
|
||||||
npm run production
|
npm run production
|
||||||
else
|
else
|
||||||
echo "Skipping [npm run production] as --build-arg [BUILD_FRONTEND] is not set to '1'"
|
echo "Skipping [npm run production] as --build-arg [BUILD_FRONTEND] is not set to '1'"
|
||||||
|
|
Loading…
Reference in a new issue