instances-api/Dockerfile

25 lines
384 B
Docker
Raw Normal View History

2022-02-14 13:05:02 +05:30
FROM golang:latest AS build
WORKDIR /app/
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags "-s -w" main.go
FROM debian:unstable-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app/
COPY --from=build /app/main /app/instances-api
EXPOSE 3000
CMD ./instances-api