Add Docker support with .dockerignore and Dockerfile
This commit is contained in:
parent
194ae55cbd
commit
ca78223d8e
33
.dockerignore
Normal file
33
.dockerignore
Normal file
@ -0,0 +1,33 @@
|
||||
# Ignore Python cache files
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
# Ignore virtual environments
|
||||
venv/
|
||||
.env/
|
||||
|
||||
# Ignore test files and directories
|
||||
tests/
|
||||
*.test.*
|
||||
|
||||
# Ignore Docker-specific files
|
||||
.dockerignore
|
||||
Dockerfile*
|
||||
|
||||
# Ignore version control files
|
||||
.git/
|
||||
.gitignore
|
||||
|
||||
# Ignore development tools and configs
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
|
||||
# Ignore logs and temp files
|
||||
*.log
|
||||
*.tmp
|
||||
*.bak
|
||||
|
||||
# Images
|
||||
*.png
|
40
Dockerfile
Normal file
40
Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM python:3.10-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache \
|
||||
postgresql-dev \
|
||||
gcc \
|
||||
musl-dev \
|
||||
libffi-dev \
|
||||
curl \
|
||||
g++ \
|
||||
make \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
tzdata
|
||||
|
||||
RUN pip install --no-cache-dir poetry
|
||||
|
||||
RUN poetry config virtualenvs.create false
|
||||
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
RUN poetry install --only main --no-interaction --no-ansi
|
||||
|
||||
FROM python:3.10-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache \
|
||||
postgresql-libs \
|
||||
libffi \
|
||||
libxml2 \
|
||||
libxslt \
|
||||
tzdata
|
||||
|
||||
COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10
|
||||
COPY --from=builder /app /app
|
||||
|
||||
ENV PYTHONPATH=/usr/local/lib/python3.10/site-packages
|
||||
|
||||
COPY . .
|
Loading…
x
Reference in New Issue
Block a user