Spaces:
Sleeping
Sleeping
# 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;'"] |