-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 788 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 788 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
# syntax = docker/dockerfile:1.21.0
# build backend
FROM golang:1.26.2-alpine as server-build
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update git
WORKDIR /github.com/traPtitech/anke-to
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -o /anke-to -ldflags "-s -w"
# run
FROM alpine:3.23.3
WORKDIR /app
RUN apk --update --no-cache add tzdata \
&& cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \
&& apk del tzdata \
&& mkdir -p /usr/share/zoneinfo/Asia \
&& ln -s /etc/localtime /usr/share/zoneinfo/Asia/Tokyo
RUN apk --update --no-cache add ca-certificates \
&& update-ca-certificates \
&& rm -rf /usr/share/ca-certificates
COPY --from=server-build /anke-to ./
ENTRYPOINT ./anke-to