Skip to content

Commit 0f5dc82

Browse files
committed
add dockerfile
1 parent 8314ca4 commit 0f5dc82

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM python:3.12-slim-bookworm
2+
3+
# Install git (needed for dynamic versioning) and poetry
4+
RUN apt-get update && \
5+
apt-get install -y git && \
6+
rm -rf /var/lib/apt/lists/* && \
7+
pip install poetry==1.8.3
8+
9+
# Configure poetry to not create virtual environments and disable interactive mode
10+
ENV POETRY_NO_INTERACTION=1 \
11+
POETRY_CACHE_DIR=/tmp/poetry_cache
12+
13+
WORKDIR /app
14+
15+
# Copy poetry files (build from project root)
16+
COPY pyproject.toml poetry.lock ./
17+
18+
# Install dependencies directly to system Python
19+
RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
20+
poetry config virtualenvs.create false && \
21+
poetry install --extras manifest-runner --no-root && \
22+
pip install fastapi uvicorn
23+
24+
# Copy the project source code (including .git for dynamic versioning)
25+
COPY . /app
26+
27+
# Install the project
28+
RUN pip install -e .
29+
30+
# Create a non-root user and group
31+
RUN groupadd --gid 1000 airbyte && \
32+
useradd --uid 1000 --gid airbyte --shell /bin/bash --create-home airbyte
33+
34+
# Change ownership
35+
RUN chown -R airbyte:airbyte /app
36+
37+
# Run app as non-root user
38+
USER airbyte:airbyte
39+
40+
EXPOSE 8080
41+
42+
CMD ["uvicorn", "airbyte_cdk.manifest_runner.app:app", "--host", "0.0.0.0", "--port", "8080"]

0 commit comments

Comments
 (0)