diff --git a/docker-image/.gitlab-ci.yml b/docker-image/.gitlab-ci.yml index 68c0e03..623709b 100644 --- a/docker-image/.gitlab-ci.yml +++ b/docker-image/.gitlab-ci.yml @@ -1,3 +1,5 @@ +--- + build: image: docker:20.10.16 stage: build @@ -7,5 +9,5 @@ build: IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_PIPELINE_IID script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker build -t $IMAGE_TAG . + - docker buildx build -t $IMAGE_TAG . - docker push $IMAGE_TAG diff --git a/docker-image/Dockerfile b/docker-image/Dockerfile index 268dfef..8da3d3e 100644 --- a/docker-image/Dockerfile +++ b/docker-image/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20.0 +FROM golang:1.23 AS builder ENV REDIS-SERVICE-NAME="redis" @@ -6,13 +6,11 @@ ENV REDIS-SERVICE-NAME="redis" WORKDIR /app ADD go.* main.go ./ RUN go mod download \ - && CGO_ENABLED=0 GOOS=linux go build -o main . + && CGO_ENABLED=0 go build -o main . FROM scratch WORKDIR /app -COPY --from=0 /app/main . -COPY ./public/index.html public/index.html -COPY ./public/script.js public/script.js -COPY ./public/style.css public/style.css -CMD ["/app/main"] +COPY --from=builder /app/main . +COPY ./public /app/public/ +ENTRYPOINT ["/app/main"] EXPOSE 3000 diff --git a/docker-image/go.mod b/docker-image/go.mod index 214ad48..6132706 100644 --- a/docker-image/go.mod +++ b/docker-image/go.mod @@ -9,7 +9,6 @@ require ( ) require ( - github.com/garyburd/redigo v1.6.4 // indirect github.com/gomodule/redigo v1.8.9 // indirect github.com/xyproto/pinterface v1.5.3 // indirect ) diff --git a/docker-image/go.sum b/docker-image/go.sum index 76e87f5..8cbb42f 100644 --- a/docker-image/go.sum +++ b/docker-image/go.sum @@ -1,24 +1,20 @@ github.com/codegangsta/negroni v1.0.0 h1:+aYywywx4bnKXWvoWtRfJ91vC59NbEhEY03sZjQhbVY= github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/garyburd/redigo v1.6.4 h1:LFu2R3+ZOPgSMWMOL+saa/zXRjw0ID2G8FepO53BGlg= -github.com/garyburd/redigo v1.6.4/go.mod h1:rTb6epsqigu3kYKBnaF028A7Tf/Aw5s0cqA47doKKqw= -github.com/gomodule/redigo v1.8.8 h1:f6cXq6RRfiyrOJEV7p3JhLDlmawGBVBBP1MggY8Mo4E= -github.com/gomodule/redigo v1.8.8/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE= github.com/gomodule/redigo v1.8.9 h1:Sl3u+2BI/kk+VEatbj0scLdrFhjPmbxOc1myhDP41ws= github.com/gomodule/redigo v1.8.9/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/xyproto/pinterface v1.5.3 h1:RKkNT88cwrSqD9hU4cYAO5yeo8srg4TG+74Pcj88iz0= github.com/xyproto/pinterface v1.5.3/go.mod h1:X5B5pKE49ak7SpyDh5QvJvLH9cC9XuZNDcl5hEyYc34= -github.com/xyproto/simpleredis v0.0.0-20150523000142-9f9bdf9000d1 h1:+vB14RyCTr3FERRzenZftip8alGqRbhx7kzS5za9/VQ= -github.com/xyproto/simpleredis v0.0.0-20150523000142-9f9bdf9000d1/go.mod h1:uSYFxIza9OX4jlWn/KHQRd0YDCXza/L/S4WatobDE0U= -github.com/xyproto/simpleredis v0.0.0-20220117114834-9a1000fbd7af h1:cysD3MzP3R/pQETtrLsxudVsc79USsWNFY27kYooQbY= -github.com/xyproto/simpleredis v0.0.0-20220117114834-9a1000fbd7af/go.mod h1:klBJiwXWN4OvxC5qVNAr7RnRYowZh9WyeAJoU6aZjZ0= github.com/xyproto/simpleredis v0.0.0-20230406121716-97efc4f25bf1 h1:d//7H6H837U72eycvfiPi/JsvbNMVbqKvcpveu6YpaA= github.com/xyproto/simpleredis v0.0.0-20230406121716-97efc4f25bf1/go.mod h1:/rLBRnXHiELDjKl1mJ6xTgVxXtwGaFl5Q1VH+Eogzhc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=