docker fix
This commit is contained in:
parent
40784cc153
commit
5ad03eeb67
12
Dockerfile
12
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Use an official Golang runtime as a parent image
|
# Use an official Golang runtime as a parent image
|
||||||
FROM golang:latest
|
FROM golang:latest as build
|
||||||
|
|
||||||
# Set the working directory to /app
|
# Set the working directory to /app
|
||||||
WORKDIR .
|
WORKDIR .
|
||||||
@ -9,11 +9,17 @@ COPY . .
|
|||||||
# Download and install any required dependencies
|
# Download and install any required dependencies
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
|
# Generate orm
|
||||||
|
RUN go generate ./database/ent
|
||||||
|
|
||||||
# Build the Go app
|
# Build the Go app
|
||||||
RUN go build .
|
RUN go build .
|
||||||
|
|
||||||
# Generate orm
|
FROM gcr.io/distroless/base-debian12
|
||||||
RUN go generate ./database/ent
|
|
||||||
|
COPY --from=build /go/portfolio .
|
||||||
|
|
||||||
|
ADD .env .
|
||||||
|
|
||||||
# Expose port 8080 for incoming traffic
|
# Expose port 8080 for incoming traffic
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user