-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (39 loc) · 1.36 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
FROM node:23.6.1-alpine3.21 AS frontend
WORKDIR /usr/src/app
COPY package.json ./
RUN npm install --ignore-scripts --include=dev
COPY internal internal/
COPY assets assets/
COPY static static/
RUN npm run build
FROM golang:1.23.5-alpine3.21 AS backend
ARG VERSION=dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY --from=frontend /usr/src/app/static static/
COPY .git .git/
COPY *.go build.sh ./
COPY internal internal/
RUN apk add --no-cache bash curl git && \
go install github.com/a-h/templ/cmd/[email protected] && templ generate && \
./build.sh -v "$VERSION"
FROM alpine:3.21.2
LABEL org.opencontainers.image.authors='[email protected]' \
org.opencontainers.image.url='https://www.portkey.page' \
org.opencontainers.image.documentation='https://github.com/kodehat/portkey' \
org.opencontainers.image.source='https://github.com/kodehat/portkey' \
org.opencontainers.image.vendor='kodehat' \
org.opencontainers.image.licenses='AGPL-3.0'
WORKDIR /opt
COPY --from=backend /app/portkey ./portkey
# Provide a default config. Can be overwritten by mounting as volume by user.
COPY config.yml .
# "curl" is added only for Docker healthchecks!
RUN apk add --no-cache tzdata curl && \
adduser -D -H nonroot && \
chmod +x ./portkey
EXPOSE 3000/tcp
USER nonroot:nonroot
ENTRYPOINT [ "/opt/portkey" ]
CMD [ "--config-path=/opt/" ]