-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (37 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
50 lines (37 loc) · 1.3 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
FROM --platform=$BUILDPLATFORM docker.io/library/alpine:latest AS builder
RUN set -euxo pipefail; \
apk add --no-cache curl libstdc++; \
curl https://mise.run | sh; \
ln -s $HOME/.local/bin/mise /usr/bin/mise
WORKDIR /build/
COPY . ./
RUN set -euxo pipefail; \
mise trust; \
mise run build:frontend:compress
ARG TARGETOS
ARG TARGETARCH
RUN set -euxo pipefail; \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} mise run build:server
FROM --platform=$BUILDPLATFORM scratch AS frontend
COPY <<EOF /etc/group
root:*:0:
nobody:*:65534:
EOF
COPY <<EOF /etc/passwd
root:*:0:0:root:/frontend/:
nobody:*:65534:65534:nobody:/frontend/:
EOF
WORKDIR /frontend/
COPY --chown=65534:65534 --from=builder /build/dist/server ./
COPY --chown=65534:65534 --from=builder /build/LICENSE ./
LABEL org.opencontainers.image.created="0001-01-01T00:00:00Z" \
org.opencontainers.image.description="The web based editor for JSPaste" \
org.opencontainers.image.licenses="EUPL-1.2" \
org.opencontainers.image.revision="unspecified" \
org.opencontainers.image.source="https://github.com/jspaste/frontend" \
org.opencontainers.image.title="jspaste-frontend" \
org.opencontainers.image.url="https://github.com/jspaste/frontend" \
org.opencontainers.image.version="unspecified"
EXPOSE 3000
USER 65534:65534
ENTRYPOINT ["/frontend/server"]