-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
106 lines (89 loc) · 3.43 KB
/
Dockerfile.dev
File metadata and controls
106 lines (89 loc) · 3.43 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Development Container - Full CDC Development Environment
# Includes Python + MSSQL CLI + PostgreSQL + Fish shell + All Dependencies
FROM python:3.13-slim
# Install system dependencies, MSSQL tools, PostgreSQL client, and Fish shell
RUN apt-get update && apt-get install -y \
curl \
gnupg2 \
apt-transport-https \
ca-certificates \
postgresql-client \
fish \
git \
vim \
docker.io \
libatomic1 \
unzip \
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \
&& curl https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y \
mssql-tools18 \
unixodbc-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install rpk CLI for Bloblang validation
RUN curl -LO https://github.com/redpanda-data/redpanda/releases/latest/download/rpk-linux-amd64.zip \
&& unzip rpk-linux-amd64.zip \
&& chmod +x rpk \
&& mv rpk /usr/local/bin/ \
&& rm rpk-linux-amd64.zip
# Install Bento runtime binary
RUN curl -fsSL https://github.com/warpstreamlabs/bento/releases/latest/download/bento_Linux_x86_64.tar.gz -o bento.tar.gz \
&& tar -xzf bento.tar.gz bento \
&& chmod +x bento \
&& mv bento /usr/local/bin/bento \
&& rm bento.tar.gz
# Add sqlcmd and workspace bin to PATH
ENV PATH="/opt/mssql-tools18/bin:/workspace:${PATH}"
# Set working directory
WORKDIR /workspace
# Copy ONLY pyproject.toml to install dependencies (not the package itself yet)
COPY pyproject.toml setup.py ./
# Install Python dependencies WITHOUT installing the package yet
# This includes all runtime dependencies, dev dependencies, and type stubs
RUN pip install --no-cache-dir \
# Core dependencies (from pyproject.toml)
pyyaml>=6.0 \
jinja2>=3.1 \
# Database drivers (full installation)
pymssql>=2.2 \
psycopg2-binary>=2.9 \
# Additional utilities
ruamel.yaml \
pyodbc \
pgcli \
# Development tools
pytest>=7.0 \
black>=23.0 \
ruff>=0.1 \
mypy>=1.0 \
pyright>=1.1 \
pylint \
# Type stubs for static type checking
types-PyYAML \
types-pymssql
# NOTE: The actual package installation happens at runtime via docker-entrypoint.sh
# This ensures we always use the latest code from the volume-mounted /workspace
# Set Python to unbuffered mode for better logging
ENV PYTHONUNBUFFERED=1
# Create Fish config directory
RUN mkdir -p /root/.config/fish/completions
# Fish completions are generated at runtime by Click's shell completion protocol.
# The eval bootstrap in cdc.fish calls `env _CDC_COMPLETE=fish_source cdc` which
# outputs a completion function that fish registers. No static file copy needed.
COPY cdc_generator/templates/init/cdc.fish /usr/share/fish/vendor_completions.d/cdc.fish
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Set Fish as default shell for root user
RUN chsh -s /usr/bin/fish root
# Auto-launch fish when bash is started (for docker compose exec dev bash)
RUN echo 'exec fish' >> /root/.bashrc
# Set Fish as default shell
ENV SHELL=/usr/bin/fish
SHELL ["/usr/bin/fish", "-c"]
# Set entrypoint to ensure package is always installed
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Default command - keep container running
CMD ["tail", "-f", "/dev/null"]