Skip to content

Commit

Permalink
discrod-memo用のdocker env追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ankuru committed Jul 11, 2024
1 parent c9b4343 commit 4d81a74
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
8 changes: 8 additions & 0 deletions discord-dev-env/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore everything
*

# Allow files
!discord_memo/**
!requirements.txt
!pyproject.toml
!poetry.lock
14 changes: 14 additions & 0 deletions discord-dev-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH="/src"

WORKDIR /src
RUN pip install poetry

COPY pyproject.toml* poetry.lock* ./
RUN poetry config virtualenvs.in-project true
RUN if [ -f pyproject.toml ]; then poetry install --no-root; fi

COPY ./discord_memo /src/discord_memo
ENTRYPOINT ["poetry", "run", "python3", "/src/discord_memo/main.py" ]
19 changes: 19 additions & 0 deletions discord-dev-env/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
discord-memo:
container_name: discord-memo-dev
tty: true

build:
context: .
dockerfile: Dockerfile

develop:
watch:
- action: sync
path: ./discord_memo
target: /src/discord_memo
- action: rebuild
path: pyproject.toml
- action: rebuild
path: ./discord_memo/
env_file: .env

0 comments on commit 4d81a74

Please sign in to comment.