Spaces:
Runtime error
Runtime error
ngin
Browse files- Dockerfile +30 -5
- nginx.conf +20 -0
Dockerfile
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM dromni/nerfstudio:0.3.2
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# build frontend viewer with node
|
| 2 |
+
FROM node:19 as viewer-frontend
|
| 3 |
+
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
RUN git clone -b radames-patch-1 https://github.com/radames/nerfstudio .
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
RUN npm install --global yarn --force
|
| 9 |
+
RUN cd nerfstudio/viewer/app && \
|
| 10 |
+
yarn install && \
|
| 11 |
+
yarn build
|
| 12 |
+
|
| 13 |
+
# install nerfstudio
|
| 14 |
FROM dromni/nerfstudio:0.3.2
|
| 15 |
|
| 16 |
+
USER root
|
| 17 |
+
RUN apt-get -y update && apt-get -y install nginx
|
| 18 |
+
RUN mkdir -p /var/cache/nginx \
|
| 19 |
+
/var/log/nginx \
|
| 20 |
+
/var/lib/nginx
|
| 21 |
+
RUN touch /var/run/nginx.pid
|
| 22 |
+
RUN chown -R 1000:1000 /var/cache/nginx \
|
| 23 |
+
/var/log/nginx \
|
| 24 |
+
/var/lib/nginx \
|
| 25 |
+
/var/run/nginx.pid
|
| 26 |
|
| 27 |
+
# copy frontend static to nginx server
|
| 28 |
+
COPY nginx.conf /etc/nginx/sites-available/default
|
| 29 |
+
COPY --from=viewer-frontend /app/nerfstudio/viewer/app/build /usr/share/nginx/html
|
| 30 |
|
| 31 |
+
EXPOSE 8080
|
| 32 |
+
USER 1000
|
| 33 |
+
RUN ["ns-download-data", "nerfstudio", "--capture-name=bww_entrance"]
|
| 34 |
+
CMD ["/bin/sh", "-c","ns-train nerfacto --data data/nerfstudio/bww_entrance & nginx -g 'daemon off;'"]
|
nginx.conf
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 8080;
|
| 3 |
+
listen [::]:8080;
|
| 4 |
+
server_name localhost;
|
| 5 |
+
|
| 6 |
+
#access_log /var/log/nginx/host.access.log main;
|
| 7 |
+
|
| 8 |
+
location /server {
|
| 9 |
+
proxy_pass http://localhost:7007;
|
| 10 |
+
proxy_http_version 1.1;
|
| 11 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 12 |
+
proxy_set_header Connection 'upgrade';
|
| 13 |
+
proxy_set_header Host $host;
|
| 14 |
+
proxy_cache_bypass $http_upgrade;
|
| 15 |
+
}
|
| 16 |
+
location / {
|
| 17 |
+
root /usr/share/nginx/html;
|
| 18 |
+
index index.html index.htm;
|
| 19 |
+
}
|
| 20 |
+
}
|