Merge branch 'main' into renovate/golang-1.x

This commit is contained in:
ngn 2025-01-28 10:23:04 +03:00
commit 82f78ebb24
3 changed files with 47 additions and 13 deletions

View File

@ -0,0 +1,28 @@
name: Build docker image
on:
push:
branches: ["main"]
env:
REGISTRY: git.matterlinux.xyz
IMAGE: ${{gitea.repository}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: "https://github.com/actions/checkout@v4"
- name: Login to container repo
uses: "https://github.com/docker/login-action@v1"
with:
registry: ${{env.REGISTRY}}
username: ${{gitea.actor}}
password: ${{secrets.PACKAGES_TOKEN}}
- name: Build image
run: |
docker build --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest .
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest

View File

@ -2,16 +2,23 @@ FROM golang:1.23.5
WORKDIR /app WORKDIR /app
COPY *.go ./ RUN useradd runner -r -u 1001 -d /app
COPY *.mod ./ RUN chown -R runner:runner /app
COPY *.sum ./ USER runner
COPY *.mod ./
COPY *.sum ./
RUN go mod download
COPY *.go ./
COPY Makefile ./
COPY lib ./lib COPY lib ./lib
COPY log ./log COPY log ./log
COPY public ./public COPY public ./public
COPY routes ./routes COPY routes ./routes
COPY templates ./templates COPY templates ./templates
RUN go build RUN make
ENTRYPOINT ["/app/security"] ENTRYPOINT ["/app/security"]

View File

@ -1,25 +1,24 @@
# security | MatterLinux security tracker # security | MatterLinux security tracker
![](https://git.matterlinux.xyz/matter/security/actions/workflows/docker.yml/badge.svg)
Soruce code of MatterLinux's security tracker, located at Soruce code of MatterLinux's security tracker, located at
[security.matterlinux.xyz](https://security.matterlinux.xyz) [security.matterlinux.xyz](https://security.matterlinux.xyz)
### Deployment ### Deployment
Web server can be built and deployed with docker compose, here is an Web server can be deployed with docker compose, here is an example configuration:
example configuration:
```yaml ```yaml
version: "3"
services: services:
security: security:
image: mattersecurity container_name: mattersecurity
restart: unless-stopped image: git.matterlinux.xyz/matter/security
build:
context: ./
ports: ports:
- "127.0.0.1:9876:9876" - "127.0.0.1:9876:9876"
volumes: volumes:
- "./db:/app/db" - "./db:/app/db"
restart: unless-stopped
``` ```
After saving the configuration file, you can build and run the docker container: After saving the configuration file, you can run the docker container:
```bash ```bash
docker-compose up -d docker-compose up -d
``` ```