mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 07:11:53 +00:00
Improving Dockerfile
This commit is contained in:
parent
269a1de5d7
commit
bcf48fd01c
2 changed files with 10 additions and 13 deletions
17
Dockerfile
17
Dockerfile
|
@ -5,23 +5,22 @@ WORKDIR /app
|
|||
RUN ["npm", "install"]
|
||||
|
||||
COPY . /app
|
||||
RUN ["npm", "run", "compile_production" ]
|
||||
RUN ["npm", "prune","--production"]
|
||||
RUN npm run compile_production && \
|
||||
npm prune --production
|
||||
|
||||
|
||||
FROM bitnami/node:12-prod AS production
|
||||
FROM node:lts-alpine AS production
|
||||
ENV NODE_ENV="production"
|
||||
ENV PORT=8000
|
||||
|
||||
RUN ["adduser", "web", "--disabled-password"]
|
||||
RUN adduser web --disabled-password
|
||||
USER web
|
||||
RUN /bin/mkdir -p /home/web/tmp/public
|
||||
|
||||
COPY --chown=web:web --from=builder /app /app
|
||||
USER web
|
||||
WORKDIR /app
|
||||
|
||||
RUN /bin/mkdir -p /home/web/tmp/public
|
||||
RUN /bin/cp -r ./public /home/web/tmp/public
|
||||
RUN /usr/bin/touch /home/web/tmp/.updatePublic
|
||||
RUN /bin/cp -r ./public /home/web/tmp/public && \
|
||||
/bin/touch /home/web/tmp/.updatePublic
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /app
|
||||
|
||||
if [ -f "/home/web/tmp/.updatePublic" ]; then
|
||||
cp -r /home/web/tmp/public /app/public
|
||||
/bin/cp -rf /home/web/tmp/public /app
|
||||
rm -rf /home/web/tmp/public
|
||||
rm /home/web/tmp/.updatePublic
|
||||
rm -f /home/web/tmp/.updatePublic
|
||||
fi
|
||||
|
||||
node index.js
|
||||
|
|
Loading…
Reference in a new issue