-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (23 loc) · 1.07 KB
/
Makefile
File metadata and controls
27 lines (23 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
img ?=itaru2622/fastapi:trixie
base ?=python:3.14-trixie
port ?=8000
sDir ?=/opt/fastapi-samples/3catchall
wDir ?=${PWD}
build:
docker build --build-arg base=${base} --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg no_proxy=${no_proxy} -t ${img} .
# test embeded sample to check if fastapi works.
test:
docker run -it --rm -p ${port}:8000 -w ${sDir} \
-e http_proxy=${http_proxy} -e https_proxy=${https_proxy} -e no_proxy=${no_proxy} \
-e app=main:app \
-e opts='--host 0.0.0.0 --reload --reload-include "*.py" --reload-include "*.conf"' \
-e pip_install_opt='--upgrade --upgrade-strategy eager' \
${img}
# start your app, you can tune more as described in README.md, such as apt_requirements, and custom start.sh
start:
docker run -it --rm -p ${port}:8000 -v ${wDir}:${wDir} -w ${wDir} \
-e http_proxy=${http_proxy} -e https_proxy=${https_proxy} -e no_proxy=${no_proxy} \
-e app=main:app \
-e opts='--host 0.0.0.0 --reload --reload-include "*.py" --reload-include "*.conf"' \
-e pip_install_opt='--upgrade --upgrade-strategy eager' \
${img}