Use simplified entrypoint script

This commit is contained in:
Joakim Fors 2020-06-18 14:23:59 +02:00
parent 6b96f224ae
commit 16de5be673
3 changed files with 17 additions and 4 deletions

View File

@ -3,4 +3,4 @@
!public
!package.json
!package-lock.json
!run.sh
!docker-entrypoint.sh

View File

@ -40,12 +40,12 @@ RUN export DEBIAN_FRONTEND=noninteractive \
libprotobuf17 \
libxxf86vm1 \
xvfb \
x11-utils \
xauth \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/src/app /usr/src/app
COPY --from=builder /usr/src/app /app
ENV NODE_ENV="production"
ENV CHOKIDAR_USEPOLLING=1
@ -56,4 +56,6 @@ WORKDIR /data
EXPOSE 80
ENTRYPOINT ["/usr/src/app/run.sh"]
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["-p", "80"]

11
docker-entrypoint.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
set -e
if ! which -- "${1}"; then
# first arg is not an executable
xvfb-run --server-args="-screen 0 1024x768x24" -- node /app/ "$@"
exit $?
fi
exec "$@"