-
Notifications
You must be signed in to change notification settings - Fork 31
/
Dockerfile
42 lines (29 loc) · 1.37 KB
/
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
FROM docker.io/node:18 as build
LABEL maintainer="Martijn Pepping <[email protected]>"
ARG VERSION
RUN chown -R node:node /srv
USER node
WORKDIR /srv
RUN git clone -b "$VERSION" --depth=1 https://github.com/gchq/CyberChef.git .
RUN npm install
ENV NODE_OPTIONS="--max-old-space-size=2048"
RUN npx grunt prod
FROM docker.io/nginxinc/nginx-unprivileged:alpine as app
LABEL maintainer="Martijn Pepping <[email protected]>" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-ref="github.com/mpepping/docker-cyberchef" \
org.label-schema.name="mpepping/cyberchef" \
org.label-schema.description="CyberChef" \
org.label-schema.url="https://github.com/mpepping/docker-cyberchef" \
org.label-schema.vcs-url="https://github.com/mpepping/docker-cyberchef" \
org.label-schema.vendor="Martijn Pepping" \
org.label-schema.docker.cmd="docker run -it mpepping/cyberchef:latest"
# old http-server was running on port 8000, avoid breaking change; also, add IPv6 listener
RUN sed -i \
-e 's/listen 8080;/listen 8000;/g' \
-e '/listen 8000;/a\' \
-e ' listen [::]:8000;' /etc/nginx/conf.d/default.conf
COPY --from=build /srv/build/prod /usr/share/nginx/html
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -sf -o /dev/null http://localhost:8000 || exit 1
EXPOSE 8000