File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed
Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 3333 context : .
3434 dockerfile : Dockerfile
3535 push : true
36- platforms : linux/amd64,linux/arm64
36+ platforms : linux/amd64
3737 tags : ghcr.io/${{ github.repository }}/${{ secrets.DOCKER_CONTAINER_NAME }}:v1.0.0
3838 cache-from : type=gha
3939 cache-to : type=gha,mode=max
7272 cat > .env << EOF
7373 APP_PORT=${{ secrets.APP_PORT }}
7474 DOCKER_CONTAINER_NAME=${{ secrets.DOCKER_CONTAINER_NAME }}
75- GITHUB_REPOSITORY=${{ github.repository }}
7675 PAT_TOKEN=${{ secrets.PAT_TOKEN }}
7776 NUMBER_NEWSLETTERS=${{ secrets.NUMBER_NEWSLETTERS }}
7877 NEWSLETTER_JID1=${{ secrets.NEWSLETTER_JID1 }}
Original file line number Diff line number Diff line change 1- FROM golang:1.25-alpine AS builder
1+ FROM golang:1.25 AS builder
22
33WORKDIR /app
44
5- RUN apk add --no-cache gcc musl-dev sqlite -dev
5+ RUN apt-get update && apt-get install -y gcc libsqlite3 -dev
66
77COPY go.mod go.sum ./
88RUN go mod download
99
1010COPY . .
1111
12- ENV CGO_ENABLED=1
13- ENV GOOS=linux
14- RUN cd cmd && go build -a -ldflags '-linkmode external -extldflags "-static"' -o main .
12+ RUN go build -ldflags="-s -w" -o main ./cmd
1513
16- FROM alpine:latest
14+ FROM debian:stable-slim
1715
18- RUN apk --no-cache add ca-certificates sqlite
16+ RUN apt-get update && apt-get install -y sqlite3 && rm -rf /var/lib/apt/lists/*
1917
2018WORKDIR /root/
21-
22- COPY --from=builder /app/cmd/main .
19+ COPY --from=builder /app/main .
2320
2421RUN mkdir -p db && chmod 777 db
2522
2623EXPOSE 8080
2724
28- CMD ["tail" , "-f" , "/dev/null " ]
25+ CMD ["./main " ]
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ services:
44 container_name : ru-counter-app
55 restart : unless-stopped
66 environment :
7+ - PAT_TOKEN=${PAT_TOKEN}
78 - NUMBER_NEWSLETTERS=${NUMBER_NEWSLETTERS}
89 - NEWSLETTER_JID1=${NEWSLETTER_JID1}
910 - NEWSLETTER_NAME1=${NEWSLETTER_NAME1}
@@ -13,6 +14,7 @@ services:
1314 - NEWSLETTER_NAME3=${NEWSLETTER_NAME3}
1415 - NEWSLETTER_JID4=${NEWSLETTER_JID4}
1516 - NEWSLETTER_NAME4=${NEWSLETTER_NAME4}
17+ - DB_PATH=file:/root/db/session.db?_foreign_keys=on
1618 volumes :
1719 - db-data:/root/db
1820 networks :
You can’t perform that action at this time.
0 commit comments