Skip to content

Commit

Permalink
build python from local.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Aug 21, 2024
1 parent 5f4ae7d commit 5bf29e1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
release:
types: [publish]

permissions:
contents: read
packages: write
issues: write
pull-requests: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down Expand Up @@ -34,10 +40,6 @@ jobs:

ghcr-build-and-publish:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
25 changes: 11 additions & 14 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,28 @@ RUN source /home/wis2downloader/.venv/bin/activate && \
python -m pip install --no-cache-dir pyopenssl==24.2.1 --upgrade

USER root
# Now copy and install python package \
# Now copy files
COPY . /home/wis2downloader/tmp
RUN chown -R wis2downloader /home/wis2downloader/tmp

USER wis2downloader
WORKDIR /home/wis2downloader/tmp
RUN source /home/wis2downloader/.venv/bin/activate && \
echo $(pwd) && \
echo $(ls) && \
python -m pip install --no-cache-dir . && \
cd .. && rm -R /home/wis2downloader/tmp

# copy config and entrypoint to the Docker image
COPY ./docker/config/. /home/wis2downloader/app/config
COPY ./docker/entrypoint.sh /home/wis2downloader/app/entrypoint.sh
COPY ./docker/clean_downloads.cron /home/wis2downloader/app/clean_downloads.cron
COPY ./docker/clean_downloads.py /home/wis2downloader/app/clean_downloads.py

USER root
RUN chown -R wis2downloader /home/wis2downloader/app && \
# set ownership / permisssions
RUN chown -R wis2downloader /home/wis2downloader/tmp && \
chown -R wis2downloader /home/wis2downloader/app && \
chmod +x /home/wis2downloader/app/entrypoint.sh && \
chmod 600 /home/wis2downloader/app/clean_downloads.py && \
chmod 600 /home/wis2downloader/app/clean_downloads.cron

USER wis2downloader
WORKDIR /home/wis2downloader/tmp
RUN source /home/wis2downloader/.venv/bin/activate && \
python -m pip install --no-cache-dir .
# clean up \
WORKDIR /home/wis2downloader/
RUN rm -R /home/wis2downloader/tmp

# Set the working directory to /app
WORKDIR /home/wis2downloader
RUN crontab ./app/clean_downloads.cron
Expand Down
2 changes: 1 addition & 1 deletion docker/tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
- "5000:5000"
depends_on:
- broker
user: 12135:$DOCKER_GID
user: "12135:$DOCKER_GID"
volumes:
- ./data:/home/wis2downloader/app/data/downloads:rw

0 comments on commit 5bf29e1

Please sign in to comment.