-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 902 Bytes
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 902 Bytes
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
# Use Python 3.11 slim image as base
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies required for cryptography and gnupg
RUN apt-get update && apt-get install -y \
gcc \
g++ \
libffi-dev \
libssl-dev \
gnupg \
git \
&& rm -rf /var/lib/apt/lists/*
# Set work directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project
COPY . .
# Install the package
RUN pip install --no-cache-dir .
# Create a non-root user
RUN useradd --create-home --shell /bin/bash gituser && \
chown -R gituser:gituser /app
USER gituser
# Set the default command
ENTRYPOINT ["git-safe"]
CMD ["--help"]