generated from iamtatsuki05/python_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebc30f1
commit 1429bef
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Sync with Hugging Face Hub | ||
|
||
'on': | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Sync with Hugging Face | ||
uses: nateraw/[email protected] | ||
with: | ||
github_repo_id: iamtatsuki05/unlock_pdf_password | ||
huggingface_repo_id: iamtatsuki05/unlock_pdf_password | ||
repo_type: space | ||
space_sdk: docker | ||
hf_token: ${{ secrets.HF_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM ubuntu:22.04 AS base | ||
|
||
ARG PYTHON_VERSION=3.10 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV WORKDIR /app/ | ||
|
||
WORKDIR /opt | ||
|
||
# install dev tools | ||
RUN apt-get update && apt-get install -y \ | ||
vim neovim nano \ | ||
git git-lfs \ | ||
zip unzip \ | ||
curl wget make build-essential xz-utils file tree \ | ||
sudo \ | ||
dnsutils \ | ||
tzdata language-pack-ja \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# for Japanese settings | ||
# ENV TZ Asia/Tokyo | ||
# ENV LANG ja_JP.utf8 | ||
|
||
# for US settings | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US | ||
|
||
# install Python | ||
RUN apt-get update && apt-get -yV upgrade && DEBIAN_FRONTEND=noninteractive apt-get -yV install \ | ||
build-essential libssl-dev libffi-dev \ | ||
python${PYTHON_VERSION} python${PYTHON_VERSION}-distutils python${PYTHON_VERSION}-dev \ | ||
&& ln -s /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python3 \ | ||
&& ln -s /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
## install pip | ||
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ | ||
&& python3 get-pip.py \ | ||
&& pip3 --no-cache-dir install --upgrade pip | ||
|
||
## install Poetry | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
ENV PATH $PATH:/root/.local/bin | ||
RUN poetry config virtualenvs.create true \ | ||
&& poetry config virtualenvs.in-project false | ||
|
||
WORKDIR ${WORKDIR} | ||
|
||
# install python packages | ||
COPY poetry.lock pyproject.toml ./ | ||
COPY src ./src | ||
RUN poetry install --no-dev | ||
|
||
FROM base AS dev | ||
WORKDIR ${WORKDIR} | ||
|
||
# install python packages | ||
COPY poetry.lock pyproject.toml ./ | ||
COPY src ./src | ||
RUN poetry install | ||
|
||
# Hugging Face Hub Settings | ||
CMD ["poetry", "run", "streamlit", "run", "src/app.py", "--server.port", "7860"] |