add build

This commit is contained in:
Dennis Jekubczyk
2021-05-24 11:44:04 +02:00
parent b1be8a3990
commit fab90936cd
4 changed files with 22 additions and 9 deletions

View File

@@ -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" ]

View File

@@ -16,13 +16,18 @@ tasks:
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 ]

15
build/Dockerfile Normal file
View File

@@ -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" ]

View File

@@ -6,4 +6,4 @@ node_modules/
.gitignore
run-local.sh
run-local.sh