mirror of
https://github.com/amigan/aim-oscar-server.git
synced 2024-11-21 20:19:47 -05:00
attempting to reduce docker image size
This commit is contained in:
parent
7641783130
commit
e97f59a570
1 changed files with 11 additions and 7 deletions
18
Dockerfile
18
Dockerfile
|
@ -1,11 +1,14 @@
|
|||
from golang:1.17-alpine3.14
|
||||
FROM golang:1.17-alpine3.14 AS build
|
||||
|
||||
workdir /app
|
||||
copy go.mod go.sum /app
|
||||
run go mod download
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum /app
|
||||
RUN (([ ! -d "/app/vendor" ] && go mod download && go mod vendor) || true)
|
||||
|
||||
copy . /app
|
||||
run go build -o /app/aim
|
||||
COPY . /app
|
||||
RUN go build -ldflags="-s -w" -mod vendor -o "aim" main.go
|
||||
RUN chmod +x "aim"
|
||||
|
||||
FROM scratch AS prod
|
||||
|
||||
EXPOSE 5190
|
||||
ARG OSCAR_HOST
|
||||
|
@ -13,4 +16,5 @@ ARG OSCAR_PORT
|
|||
ARG OSCAR_BOS_HOST
|
||||
ARG OSCAR_BOS_PORT
|
||||
|
||||
cmd /app/aim
|
||||
COPY --from=build /app/aim /app/aim
|
||||
ENTRYPOINT /app/aim
|
||||
|
|
Loading…
Reference in a new issue