-
Notifications
You must be signed in to change notification settings - Fork 47
/
Dockerfile
33 lines (21 loc) · 785 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
# Builder Image
# ---------------------------------------------------
FROM dimaskiddo/alpine:go-1.21 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/alpine:base-glibc
MAINTAINER Dimas Restu Hidayanto <dimas.restu@student.upi.edu>
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"]