Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -119,6 +119,31 @@ More exotic linux distros (eg, alpine) are not tested and the Dev Mode is not gu
|
|
119 |
|
120 |
### Example of compatible Dockerfiles
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
There are several examples of Dev Mode compatible Docker Spaces in this organization.
|
123 |
Feel free to duplicate them in your namespace!
|
124 |
|
|
|
119 |
|
120 |
### Example of compatible Dockerfiles
|
121 |
|
122 |
+
This is an example of a Dockerfile compatible with Spaces Dev Mode.
|
123 |
+
|
124 |
+
It installs the required packages with `apt-get`, along with a couple more for developer convenience (namely: `top`, `vim` and `nano`).
|
125 |
+
It then starts a NodeJS application from `/app`.
|
126 |
+
|
127 |
+
```Dockerfile
|
128 |
+
FROM node:19-slim
|
129 |
+
|
130 |
+
RUN apt-get update && \
|
131 |
+
apt-get install -y \
|
132 |
+
bash \
|
133 |
+
git git-lfs \
|
134 |
+
wget curl procps \
|
135 |
+
htop vim nano && \
|
136 |
+
rm -rf /var/lib/apt/lists/*
|
137 |
+
|
138 |
+
WORKDIR /app
|
139 |
+
COPY --link --chown=1000 ./ /app
|
140 |
+
RUN npm i
|
141 |
+
|
142 |
+
RUN chown 1000 /app
|
143 |
+
USER 1000
|
144 |
+
CMD ["node", "index.mjs"]
|
145 |
+
```
|
146 |
+
|
147 |
There are several examples of Dev Mode compatible Docker Spaces in this organization.
|
148 |
Feel free to duplicate them in your namespace!
|
149 |
|