mirror of
https://github.com/arnaucube/mirror-to-gitea.git
synced 2026-02-07 11:36:45 +01:00
add build
This commit is contained in:
@@ -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" ]
|
|
||||||
@@ -16,13 +16,18 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- task: lint
|
- task: lint
|
||||||
- task: test
|
- task: test
|
||||||
|
- task: build
|
||||||
|
|
||||||
test:
|
test:
|
||||||
cmds: [ go test ./... ]
|
cmds: [ go test ./... ]
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
desc: lint app
|
desc: lint
|
||||||
cmds: [ third_party/golangci-lint/golangci-lint run ]
|
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:
|
default:
|
||||||
cmds: [ task: world ]
|
cmds: [ task: world ]
|
||||||
|
|||||||
15
build/Dockerfile
Normal file
15
build/Dockerfile
Normal 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" ]
|
||||||
Reference in New Issue
Block a user