Skip to content

Commit

Permalink
feature: support custom start.sh in topdir or bin subfolder.
Browse files Browse the repository at this point in the history
  • Loading branch information
itaru2622 committed Nov 16, 2023
1 parent fd78838 commit 97610fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ ENV py_requirements=./requirements.txt
ENV apt_requirements=./requirements-apt.txt
ENV app=main:app
ENV opts=''
ENV PATH=.:${PATH}
ENV PATH=./:./bin:${PATH}
CMD start.sh
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ you can:
- change requirement file path for apt install by apt_requirements environment variable.
- change requirement file path for pip install by py_requirements environment variable.
- change upgrade strategy for pip install by pip_install_opt environment variable.
- use your own start.sh (boot up script) to full control boot procedure. in below case, ${PWD}/start.sh or ${PWD}/bin/start.sh if exists and it is executable.

```bash
docker run --rm -it -p 8000:8000 -v ${PWD}:${PWD} -w ${PWD} -e py_requirements=${PWD}/requirements.txt -e pip_install_opt='--upgrade --upgrade-strategy eager' -e apt_requirements=${PWD}/requirements-apt.txt -e app=main:app -e opts='--host 0.0.0.0 --reload --reload-include "*.py" --reload-include "*.conf"' itaru2622/fastapi:bookworm
#
# the above cmd start docker container with:
# the above cmd starts docker container via (/usr/local/bin/)start.sh with:
#
apt install -y ${apt_requirements}
pip3 install -r ${py_requirements} ${pip_install_opt}
Expand Down

0 comments on commit 97610fb

Please sign in to comment.