Skip to content

Commit

Permalink
Simplify Dockerfile and add SSH deploy target into GitHub secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Mega-JC committed Jul 28, 2024
1 parent 6e9a742 commit 748bdcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/deploy-to-vps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.VPS_SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.VPS_HOST }}
REMOTE_USER: ${{ secrets.VPS_USER }}
TARGET: "~"
TARGET: ${{ secrets.VPS_TARGET }}
SCRIPT_AFTER: |
cp ~/config.py ~/PygameCommunityBot/config.py
cp ~/.env ~/PygameCommunityBot/.env
cd ~/PygameCommunityBot
cp ~/config.py config.py
cp ~/.env .env
docker compose stop
docker compose rm -f
sleep 60
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ RUN apt-get update \

COPY ./pyproject.toml ./requirements.txt ./

FROM builder-base AS pipinstall

RUN mkdir $VENV_PATH \
&& python -m venv $VENV_PATH \
&& . $VENV_PATH/bin/activate \
Expand All @@ -31,7 +29,7 @@ RUN mkdir $VENV_PATH \

FROM python-base AS runtime

COPY --from=pipinstall $VENV_PATH $VENV_PATH
COPY --from=builder-base $VENV_PATH $VENV_PATH

COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down

0 comments on commit 748bdcf

Please sign in to comment.