forked from dimaskiddo/go-whatsapp-multidevice-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (21 loc) · 792 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
# Builder Image
# ---------------------------------------------------
FROM dimaskiddo/debian-buster:go-1.17 AS go-builder
WORKDIR /usr/src/app
COPY . ./
RUN go mod download \
&& CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -a -o main cmd/main/main.go
# Final Image
# ---------------------------------------------------
FROM dimaskiddo/debian-buster:base
MAINTAINER Dimas Restu Hidayanto <[email protected]>
ARG SERVICE_NAME="go-whatsapp-multidevice-rest"
ENV PATH $PATH:/usr/app/${SERVICE_NAME}
WORKDIR /usr/app/${SERVICE_NAME}
RUN mkdir -p {.bin/webp,dbs} \
&& chmod 775 {.bin/webp,dbs}
COPY --from=go-builder /usr/src/app/.env.example ./.env
COPY --from=go-builder /usr/src/app/main ./main
EXPOSE 3000
VOLUME ["/usr/app/${SERVICE_NAME}/dbs"]
CMD ["main"]