You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
785 B
33 lines
785 B
# Builder Image
|
|
# ---------------------------------------------------
|
|
FROM dimaskiddo/alpine:go-1.19 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"]
|