File size: 1,404 Bytes
cdd95ee
 
 
 
3e4f6a6
fef3bc9
3e4f6a6
fef3bc9
43b9202
cdd95ee
 
 
 
 
 
 
c37fd8b
 
cdd95ee
 
 
 
 
 
 
 
 
 
c37fd8b
cdd95ee
 
 
c37fd8b
cdd95ee
 
cfa14f6
 
9db6426
cfa14f6
 
9db6426
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# build frontend viewer with node
FROM node:19 as viewer-frontend

WORKDIR /app
RUN git clone https://github.com/nerfstudio-project/nerfstudio .
# pin nerfstudio to specific commit
RUN git checkout 6d51af1a24d692d073a9e0cda06278b6a9d44818
# quick hack to point front-end to wss and current server proxied her under /server
RUN sed -i "s|websocket_url: 'ws://localhost:7007',|websocket_url: \`\${window.location.protocol === 'https:' ? 'wss' : 'ws'}://\${window.location.host}/server\`,|g" nerfstudio/viewer/app/src/reducer.js

RUN npm install --global yarn --force
RUN cd nerfstudio/viewer/app && \
    yarn install && \
    yarn build 

# install nerfstudio 
FROM dromni/nerfstudio:0.3.2

USER root
RUN apt-get -y update && apt-get -y install nginx
RUN mkdir -p /var/cache/nginx \
    /var/log/nginx \
    /var/lib/nginx
RUN touch /var/run/nginx.pid
RUN chown -R 1000:1000 /var/cache/nginx \
    /var/log/nginx \
    /var/lib/nginx \
    /var/run/nginx.pid

# copy frontend static to nginx server
COPY nginx.conf /etc/nginx/sites-available/default
COPY --from=viewer-frontend /app/nerfstudio/viewer/app/build /usr/share/nginx/html

EXPOSE 8080
USER 1000

# nerfstudio commands here
RUN ["ns-download-data", "nerfstudio", "--capture-name=redwoods2"]

# nerfstudio training with nginx to server the viewer
CMD ["/bin/sh", "-c","ns-train nerfacto --data data/nerfstudio/redwoods2 & nginx -g 'daemon off;'"]