File size: 2,584 Bytes
6934a38
2a1a32a
c72eec6
2a1a32a
6934a38
2a1a32a
c72eec6
 
 
 
 
 
 
 
 
 
 
 
 
2a1a32a
c72eec6
 
2a1a32a
 
 
 
 
 
 
 
 
6934a38
 
 
c72eec6
6934a38
 
 
 
 
 
 
c72eec6
 
2a1a32a
 
 
 
 
 
 
 
 
 
c72eec6
 
2a1a32a
c72eec6
 
 
2a1a32a
 
 
 
 
 
 
 
 
6934a38
 
 
 
c72eec6
 
 
 
 
 
5bf6e88
 
 
c72eec6
6934a38
3521eb6
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
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04

RUN apt-get update && apt-get install -y apt-utils

RUN apt-get install -y python3.11 python3.11-venv python3-pip

# Create directories and set permissions before switching to the non-root user
RUN mkdir -p /odtp/odtp-tmp \
    /odtp \
    /odtp/odtp-config \
    /odtp/odtp-app \
    /odtp/odtp-component-client \
    /odtp/odtp-logs \
    /odtp/odtp-input \
    /odtp/odtp-workdir \
    /odtp/odtp-output \
    /home/user && \
    chown -R 1000:1000 /odtp /home/user


COPY odtp-component-client/requirements.txt /odtp/odtp-tmp/odtp.requirements.txt
RUN pip install -r /odtp/odtp-tmp/odtp.requirements.txt

#######################################################################
# PLEASE INSTALL HERE ALL SYSTEM DEPENDENCIES RELATED TO YOUR TOOL
#######################################################################

# Installing dependecies from the app
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

# Dependencies

RUN apt-get update && \
    apt-get install -y zip git libglib2.0-0 libpango1.0-0 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# ffmpeg
COPY --link --from=mwader/static-ffmpeg:6.1.1 /ffmpeg /usr/local/bin/
COPY --link --from=mwader/static-ffmpeg:6.1.1 /ffprobe /usr/local/bin/

# Adjust permissions so user 1000 can access /usr/local/bin
RUN chown -R 1000:1000 /usr/local/bin/

######################################################################
# ODTP COMPONENT CONFIGURATION. 
# DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING.
######################################################################

##################################################
# ODTP Preparation
##################################################

# Switch to the "user" user
USER 1000

# Set home to the user's home directory
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# This copy all the information for running the ODTP component
COPY odtp.yml /odtp/odtp-config/odtp.yml

COPY ./odtp-component-client /odtp/odtp-component-client

COPY ./app /odtp/odtp-app
WORKDIR /odtp

##################################################
# Fix for end of the line issue on Windows
##################################################

# Switch back to root user to run sed command
USER root
RUN chown -R 1000:1000 /odtp

# Switch back to the "user" user
USER 1000
# Fix for end of the line issue on Windows. Avoid error when building on windows
RUN find /odtp -type f -iname "*.sh" -exec sed -i 's/\r$//' {} \;

EXPOSE 7860

ENTRYPOINT ["bash", "/odtp/odtp-component-client/startup.sh"]