swh:1:snp:4a9befeb2f7523efee886bd856f69e8692a72c45
Tip revision: aca1ca33620875e1c23896b2b37a1eccfe867a4e authored by Anthony Rimet on 11 October 2021, 15:23:15 UTC
12.3.0
12.3.0
Tip revision: aca1ca3
Dockerfile
FROM node:12-alpine AS build
RUN apk add --no-cache make gcc g++ python bash git openssh jq
WORKDIR /app
# see .dockerignore to know all copied files
COPY . /app/
ENV NODE_ENV="production"
RUN mkdir /app/upload && \
cp /app/config/production-dist.js /app/config/production.js && \
npm install --production && \
npm run build && \
npm cache clean --force && \
npm prune --production && \
npm run clean && \
./lodex-extended-sync
FROM node:12-alpine AS release
RUN apk add --no-cache su-exec
COPY --from=build /app /app
# ezmasterizing of lodex
# See https://github.com/Inist-CNRS/ezmaster#ezmasterizing-an-application
# cleanupScript disabled because of this commit https://github.com/Inist-CNRS/lodex/commit/4e7c542a8745f97fb21004c96489a21c5bea32a4
# change uid/gid to be compilant with Debian/Ubuntu container (and so with ezmaster-webdav)
RUN echo '{ \
"httpPort": 3000, \
"configPath": "/app/config.json", \
"dataPath": "/app/src/app/custom", \
"#cleanupScript": "/app/src/common/mongoCleanup.sh" \
}' > /etc/ezmaster.json && \
sed -i -e "s/daemon:x:2:2/daemon:x:1:1/" /etc/passwd && \
sed -i -e "s/daemon:x:2:/daemon:x:1:/" /etc/group && \
sed -i -e "s/bin:x:1:1/bin:x:2:2/" /etc/passwd && \
sed -i -e "s/bin:x:1:/bin:x:2:/" /etc/group
WORKDIR /app
ENV NODE_ENV="production"
EXPOSE 3000
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
CMD [ "npm", "start" ]