docker
This commit is contained in:
parent
365748995f
commit
a73f655559
5 changed files with 32 additions and 1 deletions
7
dennis/.dockerignore
Normal file
7
dennis/.dockerignore
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
bin/
|
||||||
|
dist/
|
||||||
|
lib/
|
||||||
|
pyvenv.cfg
|
||||||
|
|
||||||
|
build
|
||||||
|
run
|
1
dennis/.gitignore
vendored
1
dennis/.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
bin/
|
bin/
|
||||||
|
dist/
|
||||||
lib/
|
lib/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
pyvenv.cfg
|
pyvenv.cfg
|
||||||
|
|
7
dennis/Dockerfile
Normal file
7
dennis/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# syntax=docker/dockerfile:experimental
|
||||||
|
|
||||||
|
FROM python
|
||||||
|
COPY . .
|
||||||
|
RUN python -m ensurepip && pip install --upgrade --no-cache-dir -r requirements.txt
|
||||||
|
CMD ["python3", "main.py"]
|
||||||
|
EXPOSE 9696
|
16
dennis/build
Executable file
16
dennis/build
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
NAME="dennis"
|
||||||
|
FILE_PATH="dist/$NAME.tar.gz"
|
||||||
|
|
||||||
|
if [ ! -d "dist" ]; then
|
||||||
|
mkdir dist
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f $FILE_PATH ]; then
|
||||||
|
rm $FILE_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker build -t $NAME .
|
||||||
|
|
||||||
|
echo "Compressing..." && docker save $NAME | pigz > $FILE_PATH
|
|
@ -3,4 +3,4 @@ import multiprocessing
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
multiprocessing.freeze_support()
|
multiprocessing.freeze_support()
|
||||||
uvicorn.run('src.dennis:api', host="127.0.0.1", port=9696, reload=True)
|
uvicorn.run('src.dennis:api', host='0.0.0.0', port=9696, reload=False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue