-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 870 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Use the official Go image for both building and running
FROM golang:1.22-alpine
# Install necessary packages
RUN apk add --no-cache git
# Set the working directory inside the container
WORKDIR /app
# Copy go.mod and go.sum files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy the entire project
COPY . .
# Remove the unnecessary _gen.go file to avoid conflicts
RUN rm -f db/query-engine-debian-openssl-3.0.x_gen.go
# Install prisma-client-go
RUN go install github.com/steebchen/prisma-client-go@latest
# Add Go binaries to PATH
ENV PATH=$PATH:/go/bin
# Set environment variables if needed (e.g., DATABASE_URL)
# ARG DATABASE_URL
# ENV DATABASE_URL=${DATABASE_URL}
# Run Prisma db push
RUN prisma-client-go db push
# Expose necessary ports
EXPOSE 50051 8080
# Run the application using go run
CMD ["go", "run", "./server/main.go"]