-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (32 loc) · 1001 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
ARG work_dir=/go/src/github.com/Bnei-Baruch/archive-backend
ARG build_number=dev
FROM golang:1.16-alpine3.14 as build
LABEL maintainer="[email protected]"
ARG work_dir
ARG build_number
ENV GOOS=linux \
CGO_ENABLED=0
RUN apk update && \
apk add --no-cache \
git
WORKDIR ${work_dir}
COPY . .
RUN go build -ldflags "-w -X github.com/Bnei-Baruch/archive-backend/version.PreRelease=${build_number}"
FROM alpine:3.14
RUN apk update && \
apk add --no-cache \
mailx \
postfix
RUN echo "mydomain = kabbalahmedia.info" >> /etc/postfix/main.cf
RUN echo "myhostname = localhost" >> /etc/postfix/main.cf
RUN echo "myorigin = \$mydomain" >> /etc/postfix/main.cf
RUN echo "relayhost = [smtp.local]" >> /etc/postfix/main.cf
ARG work_dir
WORKDIR /app
ADD data data
COPY misc/wait-for /wait-for
COPY misc/*.sh ./
COPY misc/docker/docker-entrypoint.sh /usr/local/bin
COPY --from=build ${work_dir}/archive-backend .
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["./archive-backend", "server"]