Skip to content

Commit

Permalink
new: Dockerfile諸々を作成。
Browse files Browse the repository at this point in the history
  • Loading branch information
tasuren committed Mar 1, 2023
1 parent 9276446 commit 3cc0ea3
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# RT - Configuration of DependaBot

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
30 changes: 30 additions & 0 deletions .github/workflows/ghcr_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Push to github container register

on:
release:
types: [created]
workflow_dispatch:

jobs:
push-docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
ghcr.io/rext-dev/rt-backend-beacon
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# RT Beacon - Dockerfile

ARG IMAGE=python
ARG VARIANT=3-slim
FROM ${IMAGE}:${VARIANT} AS build-env

LABEL "org.rext-dev.rt-backend-beacon.maintainer"="rext-dev"
LABEL "org.rext-dev.rt-backend-beacon.repository"="https://github.com/rext-dev/rt-backend-beacon"

WORKDIR /tmp/rt

RUN echo "Updating package repository" && \
apt update -y && apt -y upgrade

RUN echo "Preparing neccessary tools..."
RUN apt install -y --no-install-recommends build-essential python3-dev

RUN echo "Preparing requirements..."
COPY ./requirements.txt .
COPY ./core/rextlib/requirements.txt ./rextlib_requirements.txt
RUN pip3 install --no-cache-dir -U pip setuptools wheel && \
pip3 install --no-cache-dir -U -r requirements.txt -r rextlib_requirements.txt

RUN echo "Cleaning..."
RUN cd .. && rm -rf rt
RUN apt remove -y build-essential python3-dev

RUN echo "Preparing..."
COPY . /usr/local/src
WORKDIR /usr/local/src
RUN rm config.toml &> /dev/null

ENTRYPOINT ["python3", "-OO", "main.py"]
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ RTのバックエンドのBotサーバーとAPIサーバーが通信をするた
4. リポジトリrt-backend-botとrt-backend-apiで使っている`secret.key`を、このリポジトリのルートディレクトリに配置。

## Usage
### Normal
```shell
$ python3 main.py 127.0.0.1 8765
```
### Docker
Coming soon...
```
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ipcs==0.1.*

0 comments on commit 3cc0ea3

Please sign in to comment.