-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
76 lines (56 loc) · 1.67 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# syntax=docker/dockerfile:1.4
ARG NODE_VERSION=16
FROM node:${NODE_VERSION}-alpine as build
RUN apk add --no-cache git
WORKDIR /src
COPY package.json .
COPY package-lock.json .
RUN npm i
COPY / .
ARG PUBLIC_URL=/
ARG REACT_APP_SETTINGS_PATH=/editor-settings.toml
RUN npm run build
ARG NODE_VERSION=16
FROM node:${NODE_VERSION}-alpine as caddy
RUN apk add --no-cache curl
ARG CADDY_VERSION=2.5.1
RUN curl -sSL "https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_amd64.tar.gz" | tar xzf - caddy \
&& chown 0:0 caddy \
&& chmod +x caddy
RUN mkdir -p /rootfs/config /rootfs/data \
&& chown 1000:1000 /rootfs/config /rootfs/data
FROM scratch
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data
COPY <<EOF /Caddyfile
{
admin off
}
:80 {
root * /www
file_server
}
:2019 {
metrics /metrics
respond /healthz 200
}
EOF
COPY <<EOF /etc/nsswitch.conf
hosts: files dns
EOF
COPY --from=caddy /rootfs /
COPY --from=caddy /caddy /
COPY --from=build /src/build /www
USER 1000:1000
EXPOSE 80
EXPOSE 443
EXPOSE 2019
LABEL org.opencontainers.image.title "Opencast Video Editor"
LABEL org.opencontainers.image.description "Web-based video editor for Opencast"
LABEL org.opencontainers.image.vendor "Opencast"
LABEL org.opencontainers.image.licenses "Apache-2.0"
LABEL org.opencontainers.image.url "https://github.com/opencast/opencast-editor"
LABEL org.opencontainers.image.documentation "https://github.com/opencast/opencast-editor"
LABEL org.opencontainers.image.source "https://github.com/opencast/opencast-editor"
ENTRYPOINT [ "/caddy" ]
CMD ["run", "--config", "/Caddyfile", "--adapter", "caddyfile"]