add build
Dennis Jekubczyk dennis.jekubczyk@gmail.com
Mon, 24 May 2021 11:44:04 +0200
4 files changed,
22 insertions(+),
9 deletions(-)
M
.dockerignore
→
build/Dockerfile.dockerignore
@@ -6,4 +6,4 @@ .secrets.rc
.gitignore -run-local.sh+run-local.sh
D
Dockerfile
@@ -1,7 +0,0 @@
-FROM node:lts-alpine - -WORKDIR /app -COPY package.json package-lock.json ./ -RUN npm ci -COPY . . -CMD [ "/app/docker-entrypoint.sh" ]
M
Taskfile.yml
→
Taskfile.yml
@@ -16,13 +16,18 @@ desc: run - literally - evertyhing ;)
cmds: - task: lint - task: test + - task: build test: cmds: [ go test ./... ] lint: - desc: lint app + desc: lint cmds: [ third_party/golangci-lint/golangci-lint run ] + + build: + desc: build + cmds: [ docker image build -t jaedle/mirror-to-gitea:development -f build/Dockerfile . ] default: cmds: [ task: world ]
A
build/Dockerfile
@@ -0,0 +1,15 @@
+FROM golang:1.16-alpine as builder + +WORKDIR /app +ADD . ./ + +RUN ls -al && go build -o main main.go + +FROM scratch as runtime + +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +WORKDIR /app +COPY --from=builder /app/main main + +CMD [ "/app/main" ]