-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
baded43
commit e5e48d7
Showing
8 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.pyc | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Docker Image | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: fallenbreath | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
fallenbreath/chatbridge | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 | ||
file: ./docker/Dockerfile | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
|
||
FROM python:${PYTHON_VERSION} as builder | ||
|
||
RUN pip3 install mcdreforged | ||
|
||
COPY chatbridge /build/chatbridge | ||
COPY lang /build/lang | ||
COPY __main__.py LICENSE mcdreforged.plugin.json requirements.txt /build/ | ||
RUN cd /build \ | ||
&& mcdreforged pack \ | ||
&& find . -name "requirements.txt" -exec cat '{}' \; > requirements.all.txt | ||
|
||
FROM python:${PYTHON_VERSION}-slim | ||
|
||
COPY --from=builder /build/requirements.all.txt /app/ | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends gcc build-essential libffi-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& pip3 install -r /app/requirements.all.txt \ | ||
&& apt-get purge -y --auto-remove gcc build-essential libffi-dev | ||
|
||
COPY --from=builder /build/ChatBridge.pyz /app/ | ||
WORKDIR /app | ||
ENTRYPOINT ["python3", "ChatBridge.pyz"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3' | ||
services: | ||
server: | ||
container_name: chatbridge_server | ||
restart: unless-stopped | ||
image: fallenbreath/chatbridge:latest | ||
command: server | ||
volumes: | ||
- ./ChatBridge_server.json:/app/ChatBridge_server.json | ||
ports: | ||
- '30001:30001' | ||
|
||
khl_bot: | ||
container_name: chatbridge_khl_bot | ||
restart: unless-stopped | ||
image: fallenbreath/chatbridge:latest | ||
command: kaiheila_bot | ||
volumes: | ||
- ./ChatBridge_kaiheila.json:/app/ChatBridge_kaiheila.json |