feat: debug multistage build

This commit is contained in:
П$iх 2022-07-20 01:05:08 +03:00
parent b9006e4a1b
commit 3cea551988
3 changed files with 7 additions and 10 deletions

View File

@ -9,6 +9,3 @@
# directories
/vendor/
/build/
go.mod
go.sum

View File

@ -1,7 +1,7 @@
LABEL org.opencontainers.image.authors="psssix <psssix@gmail.com>"
FROM golang:alpine as builder
LABEL org.opencontainers.image.authors="psssix <psssix@gmail.com>"
# set build environmet variables needed for multistage building
ENV CGO_ENABLED=0 \
GOOS=linux
@ -29,10 +29,10 @@ WORKDIR /
# Copy binary from build to main folder
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder build/app app
COPY --from=builder /source/build/app app
# Copy some application assets
#COPY ./database/data.json /dist/database/data.json
#COPY ./database/data.json /database/data.json
# Export necessary port
#EXPOSE 3000

View File

@ -23,7 +23,7 @@ func GetConfig() Config {
once.Do(func() {
err := cleanenv.ReadEnv(&cfg)
if err != nil {
panic(err.Error())
panic(err)
}
})
return cfg