Add Dockerfile (#111)

Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/111
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: dorianim <mail@dorian.im>
Co-committed-by: dorianim <mail@dorian.im>
This commit is contained in:
dorianim 2022-07-16 00:59:55 +02:00 committed by 6543
parent 8207586a48
commit 00e8a41c89
2 changed files with 26 additions and 0 deletions

View file

@ -26,6 +26,17 @@ pipeline:
when:
event: [ "pull_request", "push" ]
build-docker:
image: plugins/kaniko
settings:
dockerfile: Dockerfile
no_push: true
repo: Codeberg/pages-server
tags: latest
when:
event: [ "pull_request", "push" ]
path: Dockerfile
build-tag:
group: compliant
image: a6543/golang_just

15
Dockerfile Normal file
View file

@ -0,0 +1,15 @@
FROM golang:alpine as build
WORKDIR /workspace
RUN apk add ca-certificates
COPY . .
RUN CGO_ENABLED=0 go build .
FROM scratch
COPY --from=build /workspace/pages /pages
COPY --from=build \
/etc/ssl/certs/ca-certificates.crt \
/etc/ssl/certs/ca-certificates.crt
ENTRYPOINT ["/pages"]