Skip to content

Commit

Permalink
support python 3.12
Browse files Browse the repository at this point in the history
- update start.sh, support installing extra apt package on startup if requirements-apt.txt exists.
- requirements-apt.txt is inspired from requirements.txt in python pip.
  the line starts with '#' will be ignored, so that we can add comment in requirements-apt.txt.
- requirements-apt.txt is rename-able by environment variable 'apt_requirements'.
  • Loading branch information
itaru2622 committed Oct 6, 2023
1 parent c2608dc commit 0428ce9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN mkdir -p /app; echo "set mouse-=a" > /root/.vimrc;
COPY ./start.sh /usr/local/bin/start.sh
WORKDIR /app
ENV py_requirements=./requirements.txt
ENV apt_requirements=./requirements-apt.txt
ENV app=main:app
ENV opts=''
CMD /usr/local/bin/start.sh
4 changes: 4 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

if [ -r "${apt_requirements}" ]; then
apt install -y `cat ${apt_requirements} | grep -v ^#`
fi

if [ -r "./setup.py" ] || [ -r "./setup.cfg" ] || [ -r "./pyproject.toml" ]; then
pip3 install .
elif [ -r "${py_requirements}" ]; then
Expand Down

0 comments on commit 0428ce9

Please sign in to comment.