fix
This commit is contained in:
@@ -3,3 +3,5 @@ services:
|
|||||||
image: ghcr.io/jurajkubrican/knet/go-web-server:latest
|
image: ghcr.io/jurajkubrican/knet/go-web-server:latest
|
||||||
ports:
|
ports:
|
||||||
- 54321:54321/tcp
|
- 54321:54321/tcp
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
# Step 1: Build the Go binary in a separate stage
|
# Step 1: Build the Go binary in a separate stage
|
||||||
FROM golang:1.23 AS builder
|
FROM golang:1.23-alpine AS builder
|
||||||
|
|
||||||
|
RUN apk update; apk add --no-cache gcc musl-dev
|
||||||
|
ENV GCO_ENABLED=1
|
||||||
|
# ENV GOOS=linux
|
||||||
|
# ENV GOARCH=amd64
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -12,7 +17,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the Go binary with static linking for Linux
|
# Build the Go binary with static linking for Linux
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./src
|
RUN go build -o /server ./src
|
||||||
|
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|||||||
Reference in New Issue
Block a user