-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 763 Bytes
/
Dockerfile
File metadata and controls
38 lines (26 loc) · 763 Bytes
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
# syntax=docker/dockerfile:1
##
## Build
##
FROM golang:1.18.10-buster AS build
WORKDIR /app
COPY . ./
ENV GOPROXY=https://goproxy.cn,direct
RUN go build -ldflags -s -v -o das-database cmd/main.go
##
## Deploy
##
FROM ubuntu
ARG TZ=Asia/Shanghai
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y ca-certificates tzdata \
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone \
&& dpkg-reconfigure tzdata \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/das-database /app/das-database
COPY --from=build /app/config/config.example.yaml /app/config/config.yaml
EXPOSE 8118
ENTRYPOINT ["/app/das-database", "--config", "/app/config/config.yaml"]