Skip to content

Commit

Permalink
ci: make image smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Sep 26, 2023
1 parent fe4df05 commit d72b508
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
workflow_dispatch:
jobs:
publish-docker-image:
publish-latest-docker-image:
runs-on: ubuntu-latest
name: Build and publish docker image

Expand Down
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
FROM python:3.10.13-bullseye
FROM python:3.10.13-slim-bullseye

WORKDIR /app

# copy dist of web
COPY ./web/dist /app/web/dist

COPY ./requirements.txt /app/requirements.txt
COPY ./main.py /app/main.py
COPY ./free_one_api /app/free_one_api
COPY ./requirements.txt ./main.py /app/

RUN pip install -r requirements.txt
RUN pip uninstall torch tensorflow transformers -y
RUN rm -rf /usr/local/lib/python3.10/site-packages/nvidia*
RUN python main.py
RUN pip install --no-cache -r requirements.txt \
&& pip uninstall torch tensorflow transformers triton -y \
&& rm -rf /usr/local/lib/python3.10/site-packages/nvidia* \
&& python main.py

CMD [ "python", "main.py" ]

0 comments on commit d72b508

Please sign in to comment.