-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (22 loc) · 927 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
FROM golang:1.23-alpine as build
RUN apk add --update --no-cache make gcc binutils-gold musl-dev git
WORKDIR /project
ENV GOPATH /go
ENV GOCACHE /go-cache
# Seperate step to allow docker layer caching
COPY go.* ./
RUN --mount=type=cache,target=/go-cache --mount=type=cache,target=/go go mod download
#COPY depsbuild ./depsbuild
#COPY Makefile ./
#RUN --mount=type=cache,target=/go-cache --mount=type=cache,target=/go make deps
COPY . ./
RUN --mount=type=cache,target=/go-cache --mount=type=cache,target=/go make build
FROM alpine:latest as production-build
RUN mkdir -p /opt/bin
COPY --from=build /project/bin/mzotbc /opt/bin/mzotbc
RUN mkdir -p /data
COPY --from=build /project/example_config.yaml /data/config.yaml
VOLUME ["/data"]
# This command runs your application, comment out this line to compile only
CMD ["/opt/bin/mzotbc","-c","/data/config.yaml","-d","/data/mzotbc.db"]
LABEL Name=pengine Version=0.0.1