add ARM support to docker build
Some checks failed
docker / docker (push) Has been cancelled

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn 2025-05-18 14:10:28 +03:00
parent 0f2e218088
commit d525eaf6f8
Signed by: ngn
GPG Key ID: A3654DF5AD9F641D
3 changed files with 53 additions and 22 deletions

View File

@ -3,14 +3,13 @@ name: docker
on: on:
push: push:
branches: branches:
- 'main' - "main"
paths-ignore: paths-ignore:
- 'README.md' - ".*"
- 'LICENSE.txt' - "README.md"
- '*.json' - "LICENSE.txt"
- 'docker-compose.example.yml' - "*.json"
- '.prettierrc' - "docker-compose.example.yml"
- 'ups.json'
env: env:
REGISTRY: git.ngn.tf REGISTRY: git.ngn.tf
@ -23,14 +22,22 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up buildx
uses: docker/setup-buildx-action@v3
- name: Login to container repo - name: Login to container repo
uses: docker/login-action@v1 uses: docker/login-action@v3
with: with:
registry: ${{env.REGISTRY}} registry: ${{env.REGISTRY}}
username: ${{gitea.actor}} username: ${{gitea.actor}}
password: ${{secrets.PACKAGES_TOKEN}} password: ${{secrets.PACKAGES_TOKEN}}
- name: Build docker image - name: Build and push docker image
run: | uses: docker/build-push-action@v6
docker build . --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest with:
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest push: true
platforms: linux/amd64,linux/arm64
tags: ${{env.REGISTRY}}/${{env.IMAGE}}:latest

View File

@ -1,5 +1,8 @@
FROM golang:1.23.6 AS build FROM golang:1.23.6 AS build
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app WORKDIR /app
COPY go.mod . COPY go.mod .
@ -9,16 +12,19 @@ RUN go mod download
COPY . . COPY . .
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
RUN go build -o anonymousoverflow RUN go build -o anonymousoverflow
FROM scratch FROM alpine
COPY --from=build /app/anonymousoverflow /anonymousoverflow RUN adduser -h /app -D -u 1001 runner
COPY --from=build /app/anonymousoverflow /app/anonymousoverflow
COPY --from=build /etc/ssl/certs /etc/ssl/certs COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY templates /templates COPY templates /app/templates
COPY public /public COPY public /app/public
EXPOSE 8080 WORKDIR /app
CMD ["/anonymousoverflow"]
CMD ["/app/anonymousoverflow"]

View File

@ -3,8 +3,26 @@ services:
container_name: anonymous_overflow container_name: anonymous_overflow
image: git.ngn.tf/ngn/anonymous_overflow:latest image: git.ngn.tf/ngn/anonymous_overflow:latest
environment: environment:
- APP_URL=https://domain.com APP_URL: "https://ao.example.com"
- JWT_SIGNING_SECRET=secret JWT_SIGNING_SECRET: "topsecret"
FLARESOLVER: "http://flaresolverr:8191"
THEME: "dark"
ports: ports:
- 80:8080 - 8080:8080
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
restart: unless-stopped
flaresolverr:
container_name: anonymous_overflow_flaresolverr
image: ghcr.io/flaresolverr/flaresolverr:pr-1282
environment:
LOG_LEVEL: "info"
TZ: "Europe/Berlin"
LANG: "en_US"
security_opt:
- no-new-privileges:true
restart: unless-stopped restart: unless-stopped