Transformers
English
Raiff1982 commited on
Commit
87da5eb
·
verified ·
1 Parent(s): bbefeb4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+ COPY . .
5
+
6
+ # System dependencies
7
+ RUN apt-get update && apt-get install -y gcc python3-dev wget supervisor
8
+
9
+ # Install OpenVSCode Server
10
+ RUN wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.86.2/openvscode-server-v1.86.2-linux-x64.tar.gz -O /tmp/openvscode-server.tar.gz && \
11
+ tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
12
+ rm /tmp/openvscode-server.tar.gz && \
13
+ mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server && \
14
+ chown -R 1000:1000 /opt/openvscode-server
15
+
16
+ # Environment variables (no secret here)
17
+ ENV TRANSFORMERS_CACHE=/tmp/cache
18
+ ENV HF_HOME=/tmp/cache
19
+
20
+ # Create cache directory
21
+ RUN mkdir -p /tmp/cache && chmod 777 /tmp/cache
22
+
23
+ # Install requirements
24
+ COPY requirements.txt .
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
+
27
+ # Supervisor configuration
28
+ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
29
+
30
+ # Expose ports for both the application and OpenVSCode Server
31
+ EXPOSE 7860
32
+ EXPOSE 3000
33
+
34
+ # Command to run supervisor
35
+ CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]