xenecode commited on
Commit
e0aef10
·
1 Parent(s): b03b0dc

add Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -29
Dockerfile CHANGED
@@ -1,12 +1,12 @@
1
- # ==============================================================================
2
  # Production Dockerfile for Robotics Control & Data Processing API
3
- # ==============================================================================
4
 
5
  FROM ubuntu:22.04
6
 
7
- # ==============================================================================
8
  # Environment Configuration
9
- # ==============================================================================
10
  ENV DEBIAN_FRONTEND=noninteractive \
11
  SHELL=/bin/bash \
12
  PYTHONUNBUFFERED=1 \
@@ -16,16 +16,16 @@ ENV DEBIAN_FRONTEND=noninteractive \
16
  LD_PRELOAD=/lib/x86_64-linux-gnu/liblz4.so.1 \
17
  PYTHONPATH=/usr/local/lib/python3.10/site-packages
18
 
19
- # ==============================================================================
20
  # Run as root
21
- # ==============================================================================
22
  RUN useradd -m -u 1000 user
23
  USER user
24
  USER root
25
 
26
- # ==============================================================================
27
  # System Dependencies Installation
28
- # ==============================================================================
29
  RUN apt-get update && apt-get install -y --no-install-recommends \
30
  python3-dev \
31
  python3.10 \
@@ -42,26 +42,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
42
  && apt-get clean \
43
  && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
44
 
45
- # ==============================================================================
46
  # Python Dependencies Installation
47
- # ==============================================================================
48
  RUN python3 -m pip install --upgrade pip wheel setuptools
49
  RUN python3 -m pip install --no-cache-dir \
50
  Cython numpy opencv-python opencv-contrib-python \
51
  MechEyeAPI websocket-client apscheduler eventlet appwrite
52
 
53
- # ==============================================================================
54
  # Application Setup
55
- # ==============================================================================
56
  WORKDIR /app
57
 
58
  COPY requirements.txt .
59
  RUN python3 -m pip install --no-cache-dir -r requirements.txt
60
  COPY . .
61
 
62
- # ==============================================================================
63
- # Mech-Eye .deb ve Robot .so dosyalarını runtime'da indir
64
- # ==============================================================================
65
  RUN mkdir -p /app/MecheyePackage/mecheyeinstall && \
66
  curl -L -o /app/MecheyePackage/mecheyeinstall/Mech-Eye_API_2.5.0_amd64.zip \
67
  "https://cdn-obj.azureedge.net/community/community_downloads/Mech-Eye%20SDK%202.5.0/Mech-Eye_API_2.5.0_amd64.zip?se=4763-03-21T07%3A44%3A16Z&sp=r&sv=2023-11-03&sr=b&sig=KFqefXy%2BD%2B35t4BDQjm8zgbdGVA6/nwAUTqwL4djB5g%3D" && \
@@ -76,39 +73,32 @@ RUN mkdir -p /usr/local/lib/python3.10/site-packages/fair_api && \
76
  RUN rm -f /usr/local/lib/python3.10/site-packages/mecheye/profiler_utils.py
77
  COPY ./MecheyePackage/profiler_utils.py /usr/local/lib/python3.10/site-packages/mecheye/
78
 
79
- # ==============================================================================
80
- # Config ve Apache dosyaları
81
- # ==============================================================================
82
  COPY usr/local/ /tmp/usr-local/
83
  COPY etc /tmp/etc/
84
  RUN rsync -a --ignore-existing /tmp/usr-local/ /usr/local/ \
85
  && rsync -a --ignore-existing /tmp/etc/ /etc/ \
86
  && rm -rf /tmp/usr-local /tmp/etc /tmp/www
87
 
88
- # ==============================================================================
89
- # Kütüphane dosyaları ve izinler
90
- # ==============================================================================
91
  COPY lib/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/
92
  COPY lib/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/
93
  RUN ldconfig
94
 
95
- # Sadece yazılabilir dizinlere tam izin ver
96
  RUN mkdir -p /var/www/empty /tmp \
97
  && chmod -R 777 /app /usr/local /tmp /var/www/empty
98
 
99
- # ==============================================================================
100
- # PTP araçları ve diğer statik dosyalar
101
- # ==============================================================================
102
  COPY static /app/static
103
 
104
- # ==============================================================================
105
  # Expose port
106
- # ==============================================================================
107
  ENV IP_ADDRESS=0.0.0.0
108
  ENV PORT=7860
109
  EXPOSE 7860
110
 
111
- # ==============================================================================
112
  # Startup
113
- # ==============================================================================
114
  ENTRYPOINT ["/app/entrypoint.sh"]
 
1
+
2
  # Production Dockerfile for Robotics Control & Data Processing API
3
+
4
 
5
  FROM ubuntu:22.04
6
 
7
+
8
  # Environment Configuration
9
+
10
  ENV DEBIAN_FRONTEND=noninteractive \
11
  SHELL=/bin/bash \
12
  PYTHONUNBUFFERED=1 \
 
16
  LD_PRELOAD=/lib/x86_64-linux-gnu/liblz4.so.1 \
17
  PYTHONPATH=/usr/local/lib/python3.10/site-packages
18
 
19
+
20
  # Run as root
21
+
22
  RUN useradd -m -u 1000 user
23
  USER user
24
  USER root
25
 
26
+
27
  # System Dependencies Installation
28
+
29
  RUN apt-get update && apt-get install -y --no-install-recommends \
30
  python3-dev \
31
  python3.10 \
 
42
  && apt-get clean \
43
  && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
44
 
45
+
46
  # Python Dependencies Installation
47
+
48
  RUN python3 -m pip install --upgrade pip wheel setuptools
49
  RUN python3 -m pip install --no-cache-dir \
50
  Cython numpy opencv-python opencv-contrib-python \
51
  MechEyeAPI websocket-client apscheduler eventlet appwrite
52
 
53
+
54
  # Application Setup
55
+
56
  WORKDIR /app
57
 
58
  COPY requirements.txt .
59
  RUN python3 -m pip install --no-cache-dir -r requirements.txt
60
  COPY . .
61
 
 
 
 
62
  RUN mkdir -p /app/MecheyePackage/mecheyeinstall && \
63
  curl -L -o /app/MecheyePackage/mecheyeinstall/Mech-Eye_API_2.5.0_amd64.zip \
64
  "https://cdn-obj.azureedge.net/community/community_downloads/Mech-Eye%20SDK%202.5.0/Mech-Eye_API_2.5.0_amd64.zip?se=4763-03-21T07%3A44%3A16Z&sp=r&sv=2023-11-03&sr=b&sig=KFqefXy%2BD%2B35t4BDQjm8zgbdGVA6/nwAUTqwL4djB5g%3D" && \
 
73
  RUN rm -f /usr/local/lib/python3.10/site-packages/mecheye/profiler_utils.py
74
  COPY ./MecheyePackage/profiler_utils.py /usr/local/lib/python3.10/site-packages/mecheye/
75
 
76
+
77
+ # Config and Apache Files
78
+
79
  COPY usr/local/ /tmp/usr-local/
80
  COPY etc /tmp/etc/
81
  RUN rsync -a --ignore-existing /tmp/usr-local/ /usr/local/ \
82
  && rsync -a --ignore-existing /tmp/etc/ /etc/ \
83
  && rm -rf /tmp/usr-local /tmp/etc /tmp/www
84
 
85
+
86
+ # Libraries and Permissions
87
+
88
  COPY lib/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/
89
  COPY lib/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/
90
  RUN ldconfig
91
 
 
92
  RUN mkdir -p /var/www/empty /tmp \
93
  && chmod -R 777 /app /usr/local /tmp /var/www/empty
94
 
 
 
 
95
  COPY static /app/static
96
 
97
+
98
  # Expose port
 
99
  ENV IP_ADDRESS=0.0.0.0
100
  ENV PORT=7860
101
  EXPOSE 7860
102
 
 
103
  # Startup
 
104
  ENTRYPOINT ["/app/entrypoint.sh"]