diff options
| -rw-r--r-- | .dockerignore | 9 | ||||
| -rw-r--r-- | Dockerfile | 26 | ||||
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | src/.gitignore | 2 | ||||
| -rw-r--r-- | src/app.py | 2 |
5 files changed, 49 insertions, 3 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4bddc1b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git +.gitignore +README.md +src/.venv +src/__pycache__ +src/*.pyc +src/generated/* +src/uploads/* +*.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cb2ae81 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND=noninteractive \ + PYTHONUNBUFFERED=1 + +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-venv \ + pandoc \ + texlive-full \ + fonts-noto-color-emoji \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY src/requirements.txt . +RUN pip3 install --no-cache-dir -r requirements.txt --break-system-packages + +COPY src/ . + +RUN mkdir -p generated uploads + +EXPOSE 5000 + +CMD ["python3", "app.py"] @@ -23,10 +23,21 @@ a simple web app that converts markdown to pdf using pandoc and lualatex. ## run +### local + ```bash cd src/ python -m venv .venv source .venv/bin/activate pip install -r requirements.txt python app.py -```
\ No newline at end of file +``` + +### docker + +```bash +docker build -t likha-pdf . +docker run -p 5000:5000 likha-pdf +``` + +open `http://localhost:5000`
\ No newline at end of file diff --git a/src/.gitignore b/src/.gitignore index fdbd64b..fb97398 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -2,4 +2,4 @@ __pycache__/ *.pyc .venv/ generated/ -uploads/ +uploads/
\ No newline at end of file @@ -163,4 +163,4 @@ def download_pdf(filename: str): if __name__ == "__main__": - app.run(debug=True) + app.run(host="0.0.0.0", port=5000, debug=False) |
