-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (41 loc) · 1.99 KB
/
Dockerfile
File metadata and controls
51 lines (41 loc) · 1.99 KB
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
46
47
48
49
50
51
FROM node:20-bookworm
LABEL maintainer="team@semantic.works"
RUN apt-get update && apt-get -y upgrade && apt-get -y install git openssh-client rsync jq
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
echo "BUILDING FOR AMD64 through $TARGETPLATFORM"; cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-x86_64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-x86_64-unknown-linux-gnu.deb; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
echo "BUILDING FOR ARM64" && cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-aarch64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-aarch64-unknown-linux-gnu.deb; \
elif [ "$TARGETPLATFORM" = "" ]; then \
echo "BUILDING FOR AMD64 through $TARGETPLATFORM"; cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-x86_64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-x86_64-unknown-linux-gnu.deb; \
else \
echo "Target platform \"$TARGETPLATFORM\" not supported, check watchexec" ; \
exit 1; \
fi
ENV MU_SPARQL_ENDPOINT='http://database:8890/sparql'
ENV MU_APPLICATION_GRAPH='http://mu.semte.ch/application'
ENV NODE_ENV='production'
ENV HOST='0.0.0.0'
ENV PORT='80'
ENV LOG_SPARQL_ALL='true'
ENV DEBUG_AUTH_HEADERS='true'
WORKDIR /usr/src/app
COPY package.json /usr/src/app/package.json
COPY ./scripts /app/scripts
RUN npm install
COPY . /usr/src/app
RUN chmod +x /usr/src/app/run-development.sh
RUN chmod +x /usr/src/app/run-production.sh
RUN chmod +x /usr/src/app/build-production.sh
EXPOSE ${PORT}
CMD ["bash", "boot.sh"]
# This stuff only runs when building an image from the template
ONBUILD RUN rm -Rf /app/scripts
ONBUILD ADD . /app/
ONBUILD RUN /usr/src/app/build-production.sh
ONBUILD RUN if [ -f /app/on-build.sh ]; \
then \
echo "Running custom on-build.sh of child" \
&& chmod +x /app/on-build.sh \
&& /bin/bash /app/on-build.sh ;\
fi