-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
96 lines (75 loc) · 2.39 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV SECRET_KEY "temporary-secret-key"
# Set the working directory
WORKDIR /app
# Install Python and other dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.10 libopencv-dev \
libxrender1 \
libxext6 \
libgl1-mesa-glx \
libsm6 \
libx11-6 \
libxi6 \
libxxf86vm1 \
libopenal1 \
curl \
sqlite \
python3-pip \
apt-transport-https \
ca-certificates \
gnupg-agent \
software-properties-common && \
apt-get clean
# Install Docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get update && \
apt-get install -y docker-ce-cli
COPY blender-4.2.3-linux-x64 /opt/blender
RUN chmod +x /opt/blender/blender
# Add Blender to PATH
ENV PATH="/opt/blender:$PATH"
# Install Python dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . /app/
# Remove symlink and create openuav2 directory
RUN rm -f /app/openuav2 && mkdir -p /app/openuav2
# Copy run_container.sh to openuav2
COPY run_container.sh /app/openuav2/
RUN chmod +x /app/openuav2/run_container.sh
# Create docker group with same GID as host
RUN groupadd -g 999 docker && \
usermod -aG docker root
# Collect static files
# RUN python3 manage.py collectstatic --noinput
# Expose port 8000
EXPOSE 8000
# Run the application
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--timeout", "600", "dreams_laboratory.wsgi:application"]
# Install VNC and X11 dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
xvfb \
x11vnc \
xfce4 \
xfce4-terminal \
novnc \
websockify \
net-tools \
netcat \
&& apt-get clean
# Download and install TurboVNC
RUN curl -fsSL -o turbovnc.deb https://sourceforge.net/projects/turbovnc/files/3.0.3/turbovnc_3.0.3_amd64.deb/download \
&& dpkg -i turbovnc.deb \
&& rm turbovnc.deb
# Create required directories
RUN mkdir -p /root/.vnc /tmp/.X11-unix
# Set VNC password
RUN mkdir -p /root/.vnc && x11vnc -storepasswd liftoff /root/.vnc/passwd
# Expose VNC and noVNC ports
EXPOSE 5901 6080