diff --git a/.github/workflows/auto_aggregator.yml b/.github/workflows/auto_aggregator.yml index 7790bb7..64c66cd 100644 --- a/.github/workflows/auto_aggregator.yml +++ b/.github/workflows/auto_aggregator.yml @@ -20,10 +20,7 @@ jobs: run: | touch opt/.env echo "MIDRA_LAB_NOTION_API=${MIDRA_LAB_NOTION_API}" >> opt/.env - echo "NOTION_DATABASE_URL=${NOTION_DATABASE_URL}" >> opt/.env + echo "NOTION_DATABASE_ID=${NOTION_DATABASE_ID}" >> opt/.env - name: Build and run Docker Compose run: | docker-compose up -d --build - - name: Action run python - run: | - docker compose exec zenn-article-aggregator python opt/main.py diff --git a/Dockerfile b/Dockerfile index 373cd8a..fbad26e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,3 +5,9 @@ USER root COPY requirements.txt /tmp/ RUN pip install --upgrade pip setuptools \ && pip install --requirement /tmp/requirements.txt + +# スクリプトのコピー +COPY . /opt + +# コンテナ起動時に実行されるコマンドを指定 +CMD ["python", "/opt/main.py"] \ No newline at end of file diff --git a/compose.yaml b/compose.yaml index 80ffd5f..b22c2ea 100644 --- a/compose.yaml +++ b/compose.yaml @@ -5,6 +5,9 @@ services: build: . container_name: 'zenn-article-aggregator' working_dir: '/root/' + environment: + - MIDRA_LAB_NOTION_API_KEY=${MIDRA_LAB_NOTION_API_KEY} + - NOTION_DATABASE_ID=${NOTION_DATABASE_ID} tty: true env_file: - opt/.env