Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: optimize image size #1

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
env
venv
__pycache__
*.pyc
*.pyo
**/__pycache__
**/*.pyc
**/*.pyo
**/*.pyd
.Python
env/
venv/
.env
.venv
pip-log.txt
pip-delete-this-directory.txt
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.pytest_cache/
.git
.gitignore
README.md
LICENSE
tests/
docs/
.dockerignore
Dockerfile
*.md
*.txt
*.log
LICENSE
.cache
.ropeproject
*.spec
.idea/
.vscode/
**/.DS_Store
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM python:3.11-slim

LABEL description="A web-based file converter that transforms various file formats into Markdown."
# Build stage
FROM python:3.11-slim as builder

WORKDIR /app

Expand All @@ -14,12 +13,18 @@ RUN pip install --no-cache-dir poetry && \
poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi

# Runtime stage
FROM python:3.11-slim

WORKDIR /app

COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
COPY . .

ENV FLASK_APP=app.py
ENV FLASK_ENV=development
ENV PYTHONUNBUFFERED=1
ENV FLASK_APP=app.py \
FLASK_ENV=development \
PYTHONUNBUFFERED=1

EXPOSE 5000

CMD ["python", "main.py"]
CMD ["python", "main.py"]