| FROM node:lts-alpine3.22 |
|
|
| |
| ARG APP_HOME=/home/node/app |
|
|
| |
| RUN apk add --no-cache gcompat tini git git-lfs |
|
|
| |
| WORKDIR ${APP_HOME} |
|
|
| |
| ENV NODE_ENV=production |
|
|
| |
| COPY . ./ |
|
|
| RUN \ |
| echo "*** Install npm packages ***" && \ |
| npm ci --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force |
|
|
| |
| RUN \ |
| rm -f "config.yaml" || true && \ |
| ln -s "./config/config.yaml" "config.yaml" || true && \ |
| mkdir "config" || true |
|
|
| |
| RUN \ |
| echo "*** Run Webpack ***" && \ |
| node "./docker/build-lib.js" |
|
|
| |
| RUN \ |
| echo "*** Cleanup ***" && \ |
| mv "./docker/docker-entrypoint.sh" "./" && \ |
| rm -rf "./docker" && \ |
| echo "*** Make docker-entrypoint.sh executable ***" && \ |
| chmod +x "./docker-entrypoint.sh" && \ |
| echo "*** Convert line endings to Unix format ***" && \ |
| dos2unix "./docker-entrypoint.sh" |
|
|
| |
| RUN git config --global --add safe.directory "*" |
|
|
| EXPOSE 8000 |
|
|
| |
| ENTRYPOINT ["tini", "--", "./docker-entrypoint.sh"] |
|
|