lifedebugger commited on
Commit
dc15350
·
verified ·
1 Parent(s): 83597a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -3,13 +3,14 @@ FROM golang:1.21-alpine AS builder
3
 
4
  WORKDIR /app
5
 
6
- # Copy mod files and download dependencies
7
  COPY go.mod ./
8
- RUN go mod tidy
9
-
10
- # Copy the source code
11
  COPY main.go .
12
 
 
 
 
 
13
  # Build the application
14
  # CGO_ENABLED=0 ensures a static binary
15
  RUN CGO_ENABLED=0 GOOS=linux go build -o ctf-server main.go
 
3
 
4
  WORKDIR /app
5
 
6
+ # Copy source code and mod files
7
  COPY go.mod ./
 
 
 
8
  COPY main.go .
9
 
10
+ # Download dependencies
11
+ # Note: main.go must be present for 'go mod tidy' to detect imports correctly
12
+ RUN go mod tidy
13
+
14
  # Build the application
15
  # CGO_ENABLED=0 ensures a static binary
16
  RUN CGO_ENABLED=0 GOOS=linux go build -o ctf-server main.go