forked from keploy/samples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (18 loc) · 846 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (18 loc) · 846 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
FROM python:3.11.5-bullseye
# Set working directory
WORKDIR /app
# Copy all files
COPY . /app/
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
# Install system CA certificates (Debian-based)
RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
# Download Keploy CA and setup script
ADD https://raw.githubusercontent.com/keploy/keploy/refs/heads/main/pkg/core/proxy/tls/asset/ca.crt ca.crt
ADD https://raw.githubusercontent.com/keploy/keploy/refs/heads/main/pkg/core/proxy/tls/asset/setup_ca.sh setup_ca.sh
# Make the script executable
RUN chmod +x setup_ca.sh
# Expose FastAPI port
EXPOSE 8000
# Run the Keploy CA setup script and then start FastAPI
CMD ["/bin/bash", "-c", "source ./setup_ca.sh && uvicorn main:app --host 0.0.0.0 --port 8000"]