Skip to content

Commit

Permalink
낚시카드 렌더러 docker-compose.yml에 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Jun 2, 2022
1 parent ee7d720 commit dce93d1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ venv
/.idea
/data

config.py
config.py

/.env
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
2. 새 데이터베이스를 만든 후, `setup.sql`파일이나 DB 예시 이미지를 참고로 하여 똑같이 만들어 봅니다.
3. 파이팅


### 4. 이프 설정 세팅
1. `config.py.example`를 복사한 후 복사한 파일의 이름을 `config.py`로 바꿉니다. 이는 이프의 설정 파일입니다.
2. 아래 주의사항을 참고하여 config.py를 작성합니다.
Expand All @@ -62,6 +61,14 @@
* `Constants.py`에 테마를 등록하지 않아도 `/미리보기 <테마명> <등급번호: 0~5>` 명령어를 통해 해당 테마를 테스트해볼 수 있습니다.
* [pikokr/fishcard-editor](https://github.com/pikokr/fishcard-editor) : 낚시카드 제작기(Read-Only)

#### 도커를 사용해 낚시카드 서버 세팅하기

```shell
python scripts/gensecret.py

docker compose up -d image
```

### 6. 이프 실행하기
1. 구동할 때는 main.py를 실행하시면 됩니다. 프로젝트 폴더에서 `python main.py` (Windows일 경우 `run.bat` 파일을 실행하셔도 됩니다.)

Expand Down
12 changes: 5 additions & 7 deletions config.example.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
""" <config.py> """
from dotenv import load_dotenv
import os

load_dotenv()

""" Debug Option """
debug = True
query_logging = False


"""Administrator Setting"""
ADMINS = [
281689852167061506, # 키뮤
]


""" PostgreSQL Database Configuration """
HOST = "127.0.0.1" # HOST를 localhost로 세팅할 경우 HOST를 사용하지 않음(DB 서버와 이프 서버를 같이 돌릴 경우 권장)
DBNAME = "postgres"
USER = "postgres"
PASSWORD = "test"
PORT = "5432"


""" FishCard Server Setting"""
CARD_SERVER = "" # 슬래시로 끝내지 말아주세요
CARD_TOKEN = ""

CARD_SERVER = "http://localhost:3000" # 슬래시로 끝내지 말아주세요
CARD_TOKEN = os.getenv('IMAGE_GENERATOR_TOKEN', '') # python scripts/genscript.py

""" Discord Bot Configuration """
TOKEN = ""
Expand All @@ -39,7 +38,6 @@
]
DEBUG_ACTIVITIES = ["버그 수정 중. . ."]


""" Loggin & Announcement Channel Setting """
ERROR_LOGGING_CHANNEL = 1234567890
ANNOUNCE_CHANNEL = 1234567890
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ services:
volumes:
- ./setup.sql:/docker-entrypoint-initdb.d/setup.sql
- ./data/db:/var/lib/postgresql/data
image:
image: pikokr/epbot-origin-image-generator
ports:
- '3000:3000'
environment:
JWT_TOKEN: ${IMAGE_GENERATOR_TOKEN}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pycparser==2.21
PyJWT==2.4.0
PyNaCl==1.5.0
pyparsing==3.0.9
python-dotenv==0.20.0
pytz==2020.5
requests==2.25.1
requests-toolbelt==0.9.1
Expand Down
4 changes: 4 additions & 0 deletions scripts/gensecret.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import secrets

with open('.env', 'a') as f:
f.writelines([f'IMAGE_GENERATOR_TOKEN={secrets.token_hex(24)}', '\n'])

0 comments on commit dce93d1

Please sign in to comment.