File size: 1,343 Bytes
8555e23
3450e6b
220f8ca
3450e6b
220f8ca
3450e6b
416fd99
 
ab5fc39
745b10c
561087f
e1fffbd
745b10c
 
 
 
 
 
 
e1fffbd
416fd99
e1fffbd
 
 
 
 
 
 
 
 
 
 
3450e6b
220f8ca
 
 
 
 
 
 
 
 
 
e1fffbd
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
FROM nvidia/cuda:11.7.1-base-ubuntu22.04

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN apt-cache search mesa
RUN apt-get update && apt-get install -y libgl1-mesa-glx libosmesa6
RUN apt-get install -y python3-opengl
RUN apt update && apt install -y python3 python3-pip git python-opengl xvfb xorg-dev cmake
RUN apt-get upgrade -y && apt-get install -y python3-pip python-is-python3 && rm -rf /var/lib/apt/lists/* 
RUN pip install -r requirements.txt
RUN mkdir /projects
RUN git clone https://github.com/glfw/glfw.git /projects/glfw
RUN cd /projects/glfw
RUN cmake -DBUILD_SHARED_LIBS=ON .
RUN make
RUN export PYGLFW_LIBRARY=/projects/glfw/src/libglfw.so
RUN xvfb-run python3 some_script_using_pyopengl_and_glfw.py

# Run the command inside your image filesystem
# RUN pip install --upgrade pip && \
#     pip install gym && \
#     pip install gym[atari] && \
#     pip install PyOpenGL==3.1.0 && \
#     pip install dm_control && \
#     pip install tqdm && \
#     pip install np_utils && \
#     pip install Pillow && \
#     pip install fastapi && \
#     pip install uvicorn &&\
#     pip install boto3

RUN useradd -m -u 1000 user
USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

COPY --chown=user . $HOME/app

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]