fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.6 #3
28
.gitea/workflows/docker.yml
Normal file
28
.gitea/workflows/docker.yml
Normal 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
|
11
Dockerfile
11
Dockerfile
@ -2,16 +2,23 @@ FROM golang:1.23.2
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY *.go ./
|
RUN useradd runner -r -u 1001 -d /app
|
||||||
|
RUN chown -R runner:runner /app
|
||||||
|
USER runner
|
||||||
|
|
||||||
COPY *.mod ./
|
COPY *.mod ./
|
||||||
COPY *.sum ./
|
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/tracker"]
|
ENTRYPOINT ["/app/tracker"]
|
||||||
|
17
README.md
17
README.md
@ -1,4 +1,7 @@
|
|||||||
# tracker | MatterLinux package tracker
|
# tracker | MatterLinux package tracker
|
||||||
|
|
||||||
|
![](https://git.matterlinux.xyz/matter/tracker/actions/workflows/docker.yml/badge.svg)
|
||||||
|
|
||||||
Soruce code of MatterLinux's package tracker, located at
|
Soruce code of MatterLinux's package tracker, located at
|
||||||
[tracker.matterlinux.xyz](https://tracker.matterlinux.xyz)
|
[tracker.matterlinux.xyz](https://tracker.matterlinux.xyz)
|
||||||
|
|
||||||
@ -39,23 +42,19 @@ official MatterLinux 24 repos:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
Web server can be built and deployed with docker compose using the following
|
Web server can be deployed with docker compose using the following configuration file:
|
||||||
configuration file:
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
tracker:
|
tracker:
|
||||||
image: mattertracker
|
container_name: mattertracker
|
||||||
restart: unless-stopped
|
image: git.matterlinux.xyz/matter/tracker
|
||||||
build:
|
|
||||||
context: ./
|
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:9877:9877"
|
- "127.0.0.1:9877:9877"
|
||||||
volumes:
|
volumes:
|
||||||
- "./config.json:/app/config.json:ro"
|
- "./config.json:/app/config.json:ro"
|
||||||
|
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
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user