Merge pull request #8 from Nucrea/dev-jenkins

Dev jenkins
This commit is contained in:
Sergey Chubaryan 2025-01-23 20:27:27 +03:00 committed by GitHub
commit fb7c7ab812
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 15 deletions

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM golang:1.22-alpine AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY cmd/backend cmd/backend
COPY pkg pkg
COPY internal internal
RUN GOEXPERIMENT=boringcrypto go build -ldflags "-s -w" -o ./app ./cmd/backend
RUN chmod +x ./app
FROM alpine:3.21.2 AS production
WORKDIR /backend
COPY --from=builder /build/app .
COPY cmd/backend/config.yaml .
COPY cmd/backend/jwt_signing_key .
EXPOSE 8080
CMD ["./app", "-c", "config.yaml"]

View File

@ -1,6 +1,6 @@
services:
postgres:
image: postgres:16.4
image: postgres:16.4-alpine
shm_size: 256mb
command: |
postgres

View File

@ -1,14 +0,0 @@
FROM golang:1.22
WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify
EXPOSE 8080
COPY . .
RUN go build -v -o ./app .
RUN chmod +x ./app
CMD ["./app", "-c", "./misc/config.yaml"]