From cad728f9829ace01f62df2d33379d1d8d26f5d2b Mon Sep 17 00:00:00 2001 From: Akinimaginable Date: Sat, 11 May 2024 01:05:09 +0200 Subject: [PATCH] Made deployement more modular and updated Dockerfile --- .woodpecker/build.yaml | 4 ++-- {docker => deployment/docker}/Dockerfile | 10 +++++----- {docker => deployment/docker}/docker-compose.dev.yaml | 2 +- {docker => deployment/docker}/docker-compose.yaml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename {docker => deployment/docker}/Dockerfile (65%) rename {docker => deployment/docker}/docker-compose.dev.yaml (97%) rename {docker => deployment/docker}/docker-compose.yaml (96%) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index 88083af..955e1d9 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -3,7 +3,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.gnous.eu/${CI_REPO_OWNER}/plakken - dockerfile: docker/Dockerfile + dockerfile: deployement/docker/Dockerfile platforms: linux/amd64,linux/arm64/v8,linux/arm registry: https://git.gnous.eu tag: ${CI_COMMIT} @@ -18,7 +18,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.gnous.eu/${CI_REPO_OWNER}/plakken - dockerfile: docker/Dockerfile + dockerfile: deployement/docker/Dockerfile platforms: linux/amd64,linux/arm64/v8,linux/arm registry: https://git.gnous.eu tags: diff --git a/docker/Dockerfile b/deployment/docker/Dockerfile similarity index 65% rename from docker/Dockerfile rename to deployment/docker/Dockerfile index f50175c..71dfe52 100644 --- a/docker/Dockerfile +++ b/deployment/docker/Dockerfile @@ -1,18 +1,18 @@ # Build FROM golang:1.22 AS build -LABEL authors="gnousEU" WORKDIR /build COPY go.mod go.sum ./ RUN go mod download -COPY main.go ./ -COPY internal/ ./internal COPY static/ ./static COPY templates/ ./templates +COPY main.go ./ +COPY internal/ ./internal -RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" # Enable static binary, target Linux, remove debug information and strip binary +# Enable static binary, target Linux, remove debug information and strip binary +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" # Copy to our image FROM gcr.io/distroless/static-debian12:nonroot @@ -25,4 +25,4 @@ ENV PLAKKEN_LISTEN ":3000" EXPOSE 3000/tcp -ENTRYPOINT ["/app/plakken"] +ENTRYPOINT ["/app/plakken"] \ No newline at end of file diff --git a/docker/docker-compose.dev.yaml b/deployment/docker/docker-compose.dev.yaml similarity index 97% rename from docker/docker-compose.dev.yaml rename to deployment/docker/docker-compose.dev.yaml index 8ec1e6e..7270d45 100644 --- a/docker/docker-compose.dev.yaml +++ b/deployment/docker/docker-compose.dev.yaml @@ -28,4 +28,4 @@ services: healthcheck: test: [ "CMD", "redis-cli", "ping" ] networks: - - plakken + - plakken \ No newline at end of file diff --git a/docker/docker-compose.yaml b/deployment/docker/docker-compose.yaml similarity index 96% rename from docker/docker-compose.yaml rename to deployment/docker/docker-compose.yaml index 1dc30b0..aca9237 100644 --- a/docker/docker-compose.yaml +++ b/deployment/docker/docker-compose.yaml @@ -33,4 +33,4 @@ services: networks: - plakken volumes: - - redis:/data + - redis:/data \ No newline at end of file -- 2.45.2