aripbae commited on
Commit
8596ff5
·
verified ·
1 Parent(s): b976bb0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM golang:bookworm AS builder
2
+
3
+ WORKDIR /app
4
+
5
+ COPY go.mod go.sum ./
6
+ RUN go mod download
7
+
8
+ COPY . .
9
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o main .
10
+
11
+ FROM debian:bookworm-slim
12
+
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ wget \
15
+ gnupg \
16
+ ca-certificates \
17
+ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-keyring.gpg \
18
+ && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
19
+ && apt-get update && apt-get install -y --no-install-recommends \
20
+ google-chrome-stable \
21
+ fonts-ipafont-gothic \
22
+ fonts-wqy-zenhei \
23
+ fonts-thai-tlwg \
24
+ fonts-kacst \
25
+ fonts-freefont-ttf \
26
+ libxss1 \
27
+ && apt-get clean \
28
+ && rm -rf /var/lib/apt/lists/*
29
+
30
+ WORKDIR /app
31
+
32
+ COPY --from=builder /app/main .
33
+
34
+ RUN mkdir -p /tmp && chmod 777 /tmp
35
+
36
+ ENV CHROME_PATH=/usr/bin/google-chrome-stable
37
+ ENV HOME=/tmp
38
+
39
+ EXPOSE 7860
40
+
41
+ CMD ["./main"]