-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
37 lines (28 loc) · 1.15 KB
/
Dockerfile
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
FROM ubuntu:latest
# Set environment variables to non-interactive
ENV DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
# Update and install dependencies
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y python3-pip python3-venv \
gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gir1.2-gst-plugins-bad-1.0 python3-gst-1.0 libcairo2 libcairo2-dev \
git gstreamer1.0-python3-plugin-loader
# Create and activate a virtual environment with access to system packages
RUN python3 -m venv --system-site-packages /opt/venv
RUN echo 'source /opt/venv/bin/activate' >> /root/.bashrc
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Activate the virtual environment
RUN /bin/bash -c "\
source /opt/venv/bin/activate && \
pip install --upgrade pip"
# Set some environment variables
ENV GST_PLUGIN_PATH=/root/gst-python-ml/plugins
# allow Python to properly handle Unicode characters during logging.
ENV PYTHONIOENCODING=utf-8
COPY requirements.txt /root/
# Set the working directory (optional)
WORKDIR /root
# Set the entry point to bash for interactive use
CMD ["/bin/bash"]