File size: 1,038 Bytes
cdd95ee
 
 
 
 
 
 
 
 
 
 
 
 
c37fd8b
 
cdd95ee
 
 
 
 
 
 
 
 
 
c37fd8b
cdd95ee
 
 
c37fd8b
cdd95ee
 
cfa14f6
 
cdd95ee
cfa14f6
 
cdd95ee
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
# build frontend viewer with node
FROM node:19 as viewer-frontend

WORKDIR /app
RUN git clone -b radames-patch-1 https://github.com/radames/nerfstudio .


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=bww_entrance"]

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