|
| 1 | +FROM python:3.9.10-slim |
| 2 | + |
| 3 | +# Install system dependencies |
| 4 | +RUN apt-get update && apt-get install -y apt-utils && \ |
| 5 | + DEBIAN_FRONTEND=noninteractive apt-get install --fix-missing -y \ |
| 6 | + curl \ |
| 7 | + apt-transport-https \ |
| 8 | + gnupg \ |
| 9 | + unzip \ |
| 10 | + lsb-release \ |
| 11 | + git \ |
| 12 | + zsh \ |
| 13 | + mc \ |
| 14 | + nano \ |
| 15 | + && apt-get clean \ |
| 16 | + && rm -rf /var/lib/apt/lists/* |
| 17 | + |
| 18 | +# Install OpenTofu |
| 19 | +RUN curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh && \ |
| 20 | + chmod +x install-opentofu.sh && \ |
| 21 | + ./install-opentofu.sh --install-method deb && \ |
| 22 | + rm -f install-opentofu.sh |
| 23 | + |
| 24 | +# Install kubectl from official source |
| 25 | +RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ |
| 26 | + chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ |
| 27 | + echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list && \ |
| 28 | + chmod 644 /etc/apt/sources.list.d/kubernetes.list && \ |
| 29 | + apt-get update && apt-get install -y kubectl && \ |
| 30 | + rm -rf /var/lib/apt/lists/* |
| 31 | + |
| 32 | +# Install Helm using binary download |
| 33 | +RUN curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null && \ |
| 34 | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \ |
| 35 | + apt-get update && apt-get install -y helm && \ |
| 36 | + rm -rf /var/lib/apt/lists/* |
| 37 | + |
| 38 | +# Install Google Cloud CLI and gke-gcloud-auth-plugin |
| 39 | +RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ |
| 40 | + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ |
| 41 | + apt-get update && apt-get install -y \ |
| 42 | + google-cloud-sdk \ |
| 43 | + google-cloud-sdk-gke-gcloud-auth-plugin\ |
| 44 | + && rm -rf /var/lib/apt/lists/* |
| 45 | + |
| 46 | +# Set up working directory |
| 47 | +WORKDIR /app |
| 48 | + |
| 49 | +# Copy requirements |
| 50 | +COPY dev_requirements.txt . |
| 51 | + |
| 52 | +# Install Python dependencies |
| 53 | +RUN pip install --no-cache-dir -r dev_requirements.txt |
| 54 | + |
| 55 | +# Copy the rest of the application |
| 56 | +COPY . . |
| 57 | +RUN pip install -e . |
| 58 | + |
| 59 | +# Create directories for mounted volumes |
| 60 | +RUN mkdir -p /app/deployments /app/secrets /app/codehub /app/utils |
| 61 | + |
| 62 | +# Set up zsh as default shell |
| 63 | +RUN chsh -s /bin/zsh root && utils/mod_term.sh |
| 64 | + |
| 65 | +# Set default command |
| 66 | +CMD ["/bin/zsh"] |
| 67 | + |
| 68 | +# Volume configuration |
| 69 | +VOLUME ["/app/deployments", "/app/secrets"] |
0 commit comments