@@ -19,6 +19,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1919 python3-wheel \
2020 python3-setuptools \
2121 python3-psycopg2 \
22+ python3-venv \
2223 tzdata \
2324 && rm -rf /var/lib/apt/lists/*
2425
@@ -64,13 +65,18 @@ RUN if [ -n "${PYTHON_PIP_CONF}" ]; then \
6465# Install Yarn for frontend development
6566RUN npm install --global yarn
6667
67- # Install dependencies for Timesketch
68- COPY ./requirements.txt /timesketch-requirements.txt
69- RUN pip3 install -r /timesketch-requirements.txt
68+ # Install dependencies for Timesketch in a virtual environment
69+ COPY ["./requirements.txt" , "/timesketch-requirements.txt" ]
70+ COPY ["./test_requirements.txt" , "/timesketch-test-requirements.txt" ]
71+ RUN python3 -m venv --upgrade-deps --system-site-packages ~/.virtualenvs/timesketch \
72+ && . ~/.virtualenvs/timesketch/bin/activate \
73+ && pip install --no-cache-dir \
74+ -r /timesketch-requirements.txt \
75+ -r /timesketch-test-requirements.txt \
76+ psycopg2-binary
7077
71- # Install test dependencies for Timesketch
72- COPY ./test_requirements.txt /timesketch-test-requirements.txt
73- RUN pip3 install -r /timesketch-requirements.txt -r /timesketch-test-requirements.txt
78+ # Update the PATH to include the virtual environment
79+ ENV PATH="/root/.virtualenvs/timesketch/bin:${PATH}"
7480
7581# Copy the entrypoint script into the container
7682COPY ["./docker/dev/timesketch/docker-entrypoint.sh" , "/" ]
0 commit comments