Compare commits
No commits in common. "2b4ca31dc04d00bb1c4730e2c790b93f093f52f4" and "7a2c72e3367a096fc2bd2032b09571566dc04502" have entirely different histories.
2b4ca31dc0
...
7a2c72e336
@ -1,28 +0,0 @@
|
|||||||
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
|
|
21
Dockerfile
21
Dockerfile
@ -2,23 +2,16 @@ FROM golang:1.23.2
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN useradd runner -r -u 1001 -d /app
|
COPY *.go ./
|
||||||
RUN chown -R runner:runner /app
|
COPY *.mod ./
|
||||||
USER runner
|
COPY *.sum ./
|
||||||
|
|
||||||
COPY *.mod ./
|
|
||||||
COPY *.sum ./
|
|
||||||
|
|
||||||
RUN go mod download
|
|
||||||
|
|
||||||
COPY *.go ./
|
|
||||||
COPY Makefile ./
|
|
||||||
COPY lib ./lib
|
|
||||||
COPY log ./log
|
COPY log ./log
|
||||||
COPY public ./public
|
COPY lib ./lib
|
||||||
COPY routes ./routes
|
COPY routes ./routes
|
||||||
|
COPY public ./public
|
||||||
COPY templates ./templates
|
COPY templates ./templates
|
||||||
|
|
||||||
RUN make
|
RUN go build .
|
||||||
|
|
||||||
ENTRYPOINT ["/app/tracker"]
|
ENTRYPOINT ["/app/website"]
|
||||||
|
23
README.md
23
README.md
@ -1,24 +1,25 @@
|
|||||||
# website | MatterLinux website
|
# website | MatterLinux website
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Soruce code of Matterlinux's offical website, which is
|
Soruce code of Matterlinux's offical website, which is
|
||||||
located at [matterlinux.xyz](https://matterlinux.xyz)
|
located at [matterlinux.xyz](https://matterlinux.xyz)
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
Web server can be deployed with docker compose using the following configuration file:
|
Web server can be built and deployed with docker compose using the following
|
||||||
|
configuration file:
|
||||||
```yaml
|
```yaml
|
||||||
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
website:
|
website:
|
||||||
container_name: matterwebsite
|
image: matterwebsite
|
||||||
image: git.matterlinux.xyz/matter/website
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:9878:9878"
|
|
||||||
volumes:
|
|
||||||
- "./content:/app/content"
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:9878:9878"
|
||||||
|
volumes:
|
||||||
|
- "./content:/app/content"
|
||||||
```
|
```
|
||||||
After saving the configuration file, you can run the docker container:
|
After saving the configuration file, you can build and run the docker container:
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user