@@ -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
@@ -69,13 +70,18 @@ RUN if [ -n "${PYTHON_PIP_CONF}" ]; then \
6970# Install Yarn for frontend development
7071RUN npm install --global yarn
7172
72- # Install dependencies for Timesketch
73- COPY ./requirements.txt /timesketch-requirements.txt
74- RUN pip3 install -r /timesketch-requirements.txt
73+ # Install dependencies for Timesketch in a virtual environment
74+ COPY ["./requirements.txt" , "/timesketch-requirements.txt" ]
75+ COPY ["./test_requirements.txt" , "/timesketch-test-requirements.txt" ]
76+ RUN python3 -m venv --upgrade-deps --system-site-packages ~/.virtualenvs/timesketch \
77+ && . ~/.virtualenvs/timesketch/bin/activate \
78+ && pip install --no-cache-dir \
79+ -r /timesketch-requirements.txt \
80+ -r /timesketch-test-requirements.txt \
81+ psycopg2-binary
7582
76- # Install test dependencies for Timesketch
77- COPY ./test_requirements.txt /timesketch-test-requirements.txt
78- RUN pip3 install -r /timesketch-requirements.txt -r /timesketch-test-requirements.txt
83+ # Update the PATH to include the virtual environment
84+ ENV PATH="/root/.virtualenvs/timesketch/bin:${PATH}"
7985
8086# Copy the entrypoint script into the container
8187COPY ["./docker/dev/timesketch/docker-entrypoint.sh" , "/" ]
0 commit comments