This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: add dockerfile

+48
+37
Dockerfile
··· 1 + # Stage 1: Build the Go binary using Just 2 + FROM golang:1.20 AS builder 3 + 4 + # Install Just in the builder stage 5 + RUN apt-get update && apt-get install -y curl && \ 6 + curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin/just 7 + 8 + # Set the working directory in the container 9 + WORKDIR /app 10 + 11 + # Copy the go.mod and go.sum files first to cache the dependencies 12 + COPY go.mod go.sum ./ 13 + 14 + # Download dependencies 15 + RUN go mod download 16 + 17 + # Copy the Justfile and source code 18 + COPY Justfile . 19 + COPY . . 20 + 21 + # Build the Go binary using Just 22 + RUN just build 23 + 24 + # Stage 2: Create a lightweight image with just the binary 25 + FROM alpine:latest 26 + 27 + # Set the working directory in the container 28 + WORKDIR /app 29 + 30 + # Copy the binary from the builder stage 31 + COPY --from=builder /app/myapp . 32 + 33 + # Expose a port (optional) 34 + EXPOSE 8080 35 + 36 + # Command to run the binary 37 + CMD ["./myapp"]
+11
Justfile
··· 11 11 go mod tidy 12 12 go build -v -ldflags="-X main.Version={{current_version}}" -o bin/server server/*.go 13 13 14 + docker: 15 + docker build -t notella:{{current_version}} . 16 + docker tag notella:{{current_version}} notella:latest 17 + docker tag notella:{{current_version}} harbor.k8s.inpt.fr/net7/notella:{{current_version}} 18 + docker tag notella:{{current_version}} harbor.k8s.inpt.fr/net7/notella:latest 19 + docker push notella:{{current_version}} 20 + docker push notella:latest 21 + docker push harbor.k8s.inpt.fr/net7/notella:{{current_version}} 22 + docker push harbor.k8s.inpt.fr/net7/notella:latest 23 + 24 + 14 25 install: 15 26 just build 16 27 cp bin/server ~/.local/bin/notella