-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
57 lines (41 loc) · 1.52 KB
/
Copy pathDockerfile.dev
File metadata and controls
57 lines (41 loc) · 1.52 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Development Dockerfile for SignUpFlow API
# Single-stage build with all development dependencies
# Optimized for fast rebuilds and hot-reload
FROM python:3.11-alpine@sha256:0d55920083f1ce1e38ac292e2772f924b4f8bb4188d336c79bf66963039e6146
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
POETRY_VERSION=1.7.1 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
PORT=8000 \
HOST=0.0.0.0 \
ENVIRONMENT=development
RUN apk upgrade --no-cache \
&& apk add --no-cache \
build-base \
git \
postgresql-dev
RUN python -m venv /opt/poetry \
&& /opt/poetry/bin/pip install --no-cache-dir \
"poetry==${POETRY_VERSION}" \
"poetry-plugin-export==1.6.0"
ENV PATH="/opt/poetry/bin:${PATH}"
WORKDIR /app
COPY pyproject.toml poetry.lock* ./
RUN poetry install --no-root --without e2e
COPY api/ ./api/
COPY web/ ./web/
COPY alembic/ ./alembic/
COPY alembic.ini ./
COPY tests/ ./tests/
RUN poetry install --without e2e
RUN mkdir -p /app/data /app/logs
RUN addgroup -S signupflow && adduser -S -G signupflow signupflow \
&& chown -R signupflow:signupflow /app/data /app/logs
USER signupflow
EXPOSE 8000
HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=3)" || exit 1
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--log-level", "debug"]