mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 17:31:55 +08:00
Add docker support
This commit is contained in:
parent
9bc83b2370
commit
f3c84489e9
31
.github/workflows/push_image.yml
vendored
Normal file
31
.github/workflows/push_image.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: Docker Image CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
|
||||||
|
with:
|
||||||
|
registry: registry.cn-shanghai.aliyuncs.com
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: usual2970/certimate:latest
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,3 +15,5 @@ build
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
dist/
|
||||||
|
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM golang:1.22-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ../. /app/
|
||||||
|
|
||||||
|
RUN go build -o certimate
|
||||||
|
|
||||||
|
ENTRYPOINT ["./certimate", "serve", "--http", "0.0.0.0:8090"]
|
BIN
docker/data/data.db
Normal file
BIN
docker/data/data.db
Normal file
Binary file not shown.
BIN
docker/data/logs.db
Normal file
BIN
docker/data/logs.db
Normal file
Binary file not shown.
10
docker/docker-compose.yml
Normal file
10
docker/docker-compose.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
version: '3.0'
|
||||||
|
services:
|
||||||
|
certimate:
|
||||||
|
image: registry.cn-shanghai.aliyuncs.com/usual2970/certimate:v0.0.4
|
||||||
|
container_name: certimate
|
||||||
|
ports:
|
||||||
|
- 8090:8090
|
||||||
|
volumes:
|
||||||
|
- ./data:/app/pb_data
|
||||||
|
restart: unless-stopped
|
Loading…
x
Reference in New Issue
Block a user