Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
0f2e218088
commit
d525eaf6f8
@ -3,14 +3,13 @@ name: docker
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- "main"
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'LICENSE.txt'
|
||||
- '*.json'
|
||||
- 'docker-compose.example.yml'
|
||||
- '.prettierrc'
|
||||
- 'ups.json'
|
||||
- ".*"
|
||||
- "README.md"
|
||||
- "LICENSE.txt"
|
||||
- "*.json"
|
||||
- "docker-compose.example.yml"
|
||||
|
||||
env:
|
||||
REGISTRY: git.ngn.tf
|
||||
@ -23,14 +22,22 @@ jobs:
|
||||
- name: Checkout repository
|
||||
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
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{env.REGISTRY}}
|
||||
username: ${{gitea.actor}}
|
||||
password: ${{secrets.PACKAGES_TOKEN}}
|
||||
|
||||
- name: Build docker image
|
||||
run: |
|
||||
docker build . --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
||||
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
||||
- name: Build and push docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
||||
|
20
Dockerfile
20
Dockerfile
@ -1,5 +1,8 @@
|
||||
FROM golang:1.23.6 AS build
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod .
|
||||
@ -9,16 +12,19 @@ RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
|
||||
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
|
||||
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 templates /templates
|
||||
COPY public /public
|
||||
COPY templates /app/templates
|
||||
COPY public /app/public
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["/anonymousoverflow"]
|
||||
WORKDIR /app
|
||||
|
||||
CMD ["/app/anonymousoverflow"]
|
||||
|
@ -3,8 +3,26 @@ services:
|
||||
container_name: anonymous_overflow
|
||||
image: git.ngn.tf/ngn/anonymous_overflow:latest
|
||||
environment:
|
||||
- APP_URL=https://domain.com
|
||||
- JWT_SIGNING_SECRET=secret
|
||||
APP_URL: "https://ao.example.com"
|
||||
JWT_SIGNING_SECRET: "topsecret"
|
||||
FLARESOLVER: "http://flaresolverr:8191"
|
||||
THEME: "dark"
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user