Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
MXWXZ committed May 29, 2024
1 parent c692239 commit ae0267b
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,63 @@ jobs:
tar czvf ../${{ matrix.platform.name }} skynet
fi
cd -
- uses: actions/upload-artifact@v4
with:
name: skynet-${{ matrix.platform.os_name }}
path: ${{ matrix.platform.name }}
retention-days: 1
- name: Generate SHA-256
run: shasum -a 256 ${{ matrix.platform.name }} > ${{ matrix.platform.name }}.sha256
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
files: ${{ matrix.platform.name }}*
push_dockerhub:
needs: build_skynet
name: Push to dockerhub
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Log in
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: imwxz/skynet
- uses: actions/download-artifact@v4
with:
path: release
pattern: skynet-linux-*
merge-multiple: true
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- run: |
cd release
tar xzvf skynet-linux-x86_64.tar.gz
cd -
- name: Build and push x86_64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- run: |
cd release
rm -rf skynet
tar xzvf skynet-linux-aarch64.tar.gz
cd -
- name: Build and push aarch64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:latest

RUN useradd -s /usr/sbin/nologin -r -c "Skynet User" skynet
COPY --chown=skynet:skynet release/skynet /app

WORKDIR /app
USER skynet
EXPOSE 8080
ENTRYPOINT ["./skynet"]
CMD ["run"]
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
skynet:
build: .
restart: always
depends_on:
- redis
volumes:
- ./plugin/:/app/plugin
- ./assets/_plugin/:/app/assets/_plugin
- ./conf.yml:/app/conf.yml
- ./data.db:/app/data.db
ports:
- "8080:8080"
redis:
image: "redis:alpine"
restart: always

0 comments on commit ae0267b

Please sign in to comment.