2021-12-24 15:17:07 -05:00
|
|
|
FROM golang:1.17-alpine3.14 AS build
|
2021-12-24 13:38:22 -05:00
|
|
|
|
2021-12-24 15:17:07 -05:00
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum /app
|
2021-12-24 15:48:36 -05:00
|
|
|
RUN go mod download
|
2021-12-24 15:17:07 -05:00
|
|
|
COPY . /app
|
2021-12-24 15:48:36 -05:00
|
|
|
RUN go build -ldflags="-s -w" -o /app/aim
|
|
|
|
RUN chmod +x /app/aim
|
|
|
|
|
|
|
|
FROM golang:1.17-alpine3.14 AS prod
|
2021-12-24 15:17:07 -05:00
|
|
|
|
2021-12-24 15:48:36 -05:00
|
|
|
WORKDIR /app
|
2021-12-24 13:38:22 -05:00
|
|
|
|
|
|
|
EXPOSE 5190
|
|
|
|
ARG OSCAR_HOST
|
|
|
|
ARG OSCAR_PORT
|
|
|
|
ARG OSCAR_BOS_HOST
|
|
|
|
ARG OSCAR_BOS_PORT
|
|
|
|
|
2021-12-24 15:48:36 -05:00
|
|
|
COPY --from=build /app/models /app/models
|
2021-12-24 15:17:07 -05:00
|
|
|
COPY --from=build /app/aim /app/aim
|
2021-12-24 15:48:36 -05:00
|
|
|
CMD ["/app/aim"]
|