From ff0df644af288c685444b00d33437a2eba4aee0c Mon Sep 17 00:00:00 2001 From: JurajKubrican Date: Mon, 30 Dec 2024 15:27:41 +0100 Subject: [PATCH] fix --- docker-compose.yml | 2 ++ dockerfile | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8738262..77bf406 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,3 +3,5 @@ services: image: ghcr.io/jurajkubrican/knet/go-web-server:latest ports: - 54321:54321/tcp + volumes: + - ./data:/data diff --git a/dockerfile b/dockerfile index 4c857e3..1aed250 100644 --- a/dockerfile +++ b/dockerfile @@ -1,5 +1,10 @@ # 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 WORKDIR /app @@ -12,7 +17,7 @@ RUN go mod download COPY . . # 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