diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e34c1d35cd9e07f694f975ca15cb22307c84ea3e..06244dc65a1ad338cc0bd23a1e69cfa3618bd71c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ job_build_and_publish_image: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" script: - - echo "Publishing artifact..." + - echo "Publishing artifact ..." - ls -al - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8a87f0aa455bd0d11881b66ef1a192ac86997909 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +## 1. Basisimage auswählen +FROM golang:1.21 + +# Set the working directory inside the container +WORKDIR /app + +# Copy go.mod and go.sum files first to cache dependencies +COPY go.mod go.sum ./ + +# Copy the rest of the application code +COPY . . + +RUN go build -o artifact.bin ./*.go + +# Set environment variables +ENV HOST=0.0.0.0 + +# Expose the port the application runs on +EXPOSE 8080 + +CMD ["./artifact.bin"] + +RUN echo 'hello world' + +