-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
47 lines (30 loc) · 985 Bytes
/
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
# Use Node.js official image as base
FROM node:20-alpine AS webBuilder
# Name of a branch or a tag of proxoar/talk-web
ARG TALK_WEB_VERSION=main
ENV TALK_WEB_VERSION=${TALK_WEB_VERSION}
# Install git, make
RUN apk update && apk add --no-cache git make
# Clone the repository
WORKDIR /app
RUN git clone --depth 1 --branch $TALK_WEB_VERSION --single-branch https://github.com/proxoar/talk-web .
# Install dependencies and build
RUN make build
FROM golang:1.21-alpine AS builder
# Install git, make
RUN apk update && apk add --no-cache make
COPY ${PWD} /app
WORKDIR /app
COPY --from=webBuilder /app/build/dist web/html
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"]