mirror of
https://github.com/amigan/aim-oscar-server.git
synced 2024-11-21 20:19:47 -05:00
much smaller docker images
This commit is contained in:
parent
b016645ea7
commit
f8f5378662
2 changed files with 9 additions and 9 deletions
16
Dockerfile
16
Dockerfile
|
@ -2,15 +2,14 @@ FROM golang:1.17-alpine3.14 AS build
|
|||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum /app
|
||||
RUN go mod download && go mod vendor
|
||||
RUN ls -l /app
|
||||
|
||||
RUN go mod download
|
||||
COPY . /app
|
||||
RUN ls -l /app
|
||||
RUN go build -ldflags="-s -w" -o aim
|
||||
RUN chmod +x aim
|
||||
RUN go build -ldflags="-s -w" -o /app/aim
|
||||
RUN chmod +x /app/aim
|
||||
|
||||
FROM scratch AS prod
|
||||
FROM golang:1.17-alpine3.14 AS prod
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
EXPOSE 5190
|
||||
ARG OSCAR_HOST
|
||||
|
@ -18,5 +17,6 @@ ARG OSCAR_PORT
|
|||
ARG OSCAR_BOS_HOST
|
||||
ARG OSCAR_BOS_PORT
|
||||
|
||||
COPY --from=build /app/models /app/models
|
||||
COPY --from=build /app/aim /app/aim
|
||||
ENTRYPOINT /app/aim
|
||||
CMD ["/app/aim"]
|
||||
|
|
2
main.go
2
main.go
|
@ -89,7 +89,7 @@ func main() {
|
|||
|
||||
// dev: load in fixtures to test against
|
||||
fixture := dbfixture.New(db, dbfixture.WithRecreateTables())
|
||||
err = fixture.Load(context.Background(), os.DirFS("models"), "fixtures.yml")
|
||||
err = fixture.Load(context.Background(), os.DirFS("./models"), "fixtures.yml")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue