-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 790 Bytes
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 790 Bytes
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
# Use the official Go image as the base image
FROM golang:1.24-alpine AS builder
# Set the working directory inside the container
WORKDIR /app
# Copy go.mod and go.sum files to the workspace
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy the source code into the container
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o interviewer ./cmd/interviewer
# Use a minimal alpine image for the final stage
FROM alpine:latest
# Install ca-certificates for HTTPS requests
RUN apk --no-cache add ca-certificates
# Set the working directory
WORKDIR /root/
# Copy the binary from the builder stage
COPY --from=builder /app/interviewer .
# Expose the port the app runs on
EXPOSE 8080
# Command to run the application
CMD ["./interviewer"]