-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile-release
39 lines (25 loc) · 815 Bytes
/
Dockerfile-release
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
FROM golang:1.21-alpine AS builder
ARG WEB_VERSION
RUN if [ -z "WEB_VERSION" ]; then exit 1; fi
ENV WEB_VERSION=${WEB_VERSION}
COPY ${PWD} /app
WORKDIR /app
RUN apk update && apk add curl tar make
RUN curl -LO https://github.com/proxoar/talk-web/releases/download/$WEB_VERSION/dist.tar.gz && \
mkdir temp && \
tar -C temp -xzf dist.tar.gz && \
mv temp/* web/html && \
rm -r temp && \
rm dist.tar.gz
RUN make build
# Final step
FROM alpine
# Following commands are for installing CA certs (for proper functioning of HTTPS and other TLS)
RUN apk --update add ca-certificates && \
rm -rf /var/cache/apk/*
RUN adduser -D appuser
USER appuser
WORKDIR /home/appuser/app
COPY --from=builder /app/talk /home/appuser/app/appbin
EXPOSE 8000
CMD ["./appbin"]