YoussefSharawy91 commited on
Commit
4144cf7
·
verified ·
1 Parent(s): d9faf63

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-slim
2
+
3
+ # 1. Install git, certificates AND wget
4
+ RUN apt-get update \
5
+ && apt-get install -y --no-install-recommends \
6
+ git \
7
+ ca-certificates \
8
+ wget \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ WORKDIR /app
12
+ ARG BRANCH=experimental4
13
+ ARG SUBFOLDER=smollm-webgpu
14
+
15
+ # 2. Clone only the subfolder you need
16
+ RUN git clone --depth 1 --branch ${BRANCH} \
17
+ https://github.com/YoussefElshaarawy/transformers.js-examples.git tempdir \
18
+ && mv tempdir/${SUBFOLDER}/* . \
19
+ && rm -rf tempdir
20
+
21
+ # 3. Build your app
22
+ RUN npm install
23
+ RUN npm run build
24
+
25
+ # 4. Static server & OpenVSCode server
26
+ RUN npm install -g serve
27
+
28
+ # Download and unpack OpenVSCode server
29
+ ADD https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.86.2/openvscode-server-v1.86.2-linux-x64.tar.gz /tmp/openvscode-server.tar.gz
30
+ RUN tar -xzf /tmp/openvscode-server.tar.gz -C /opt \
31
+ && rm /tmp/openvscode-server.tar.gz \
32
+ && mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server \
33
+ && chown -R 1000:1000 /opt/openvscode-server
34
+
35
+ ENV PORT=7860
36
+ EXPOSE 7860
37
+ CMD ["sh", "-c", "serve -s dist -l tcp://0.0.0.0:${PORT:-7860}"]