-
Notifications
You must be signed in to change notification settings - Fork 31
/
22.Dockerfile
45 lines (34 loc) · 1.43 KB
/
22.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/commons as commons
FROM node:22.0-alpine3.19
LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors"
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images"
ENV LAGOON=node
ARG LAGOON_VERSION
ENV LAGOON_VERSION=$LAGOON_VERSION
# Copy commons files
COPY --from=commons /lagoon /lagoon
COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/wait-for /bin/
COPY --from=commons /sbin/tini /sbin/
COPY --from=commons /home /home
RUN fix-permissions /etc/passwd \
&& mkdir -p /home \
&& fix-permissions /home \
&& mkdir -p /app \
&& fix-permissions /app
ENV TMPDIR=/tmp \
TMP=/tmp \
HOME=/home \
# When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV`
ENV=/home/.bashrc \
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
BASH_ENV=/home/.bashrc
# Make sure Bower and NPM are allowed to be running as root
RUN echo '{ "allow_root": true }' > /home/.bowerrc \
&& echo 'unsafe-perm=true' > /home/.npmrc
WORKDIR /app
EXPOSE 3000
# tells the local development environment on which port we are running
ENV LAGOON_LOCALDEV_HTTP_PORT=3000
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.sh"]
CMD ["yarn", "run", "start"]