Open jakemorr opened 10 months ago
This ticket is being worked on casually and is considered low priority
Cannot get NRPTI Frontend to dockerize despite attempts with(out) using nginx. Given this is intended for developers who are given the same equipment to work off of and nrpti often has to be rebuilt when changes are made, the value add is low.
FROM node:14.21.3 AS build
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash \
&& export NVM_DIR="$HOME/.nvm" \
&& [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
&& nvm install 14.21.3
WORKDIR /app
COPY ./package*.json .
RUN npm install @angular/cli@7.3.7 -g
COPY . .
RUN npm ci
RUN npm run build:library:dev
EXPOSE 4200:4200
EXPOSE 4300:4300
EXPOSE 4400:4400
CMD [ "npm", "start", "--host=0.0.0.0" ]
Dockerfile would build and load, but pages were unaccessible
continuation of stage one, using a multi-stage build with nginx (appended to end of previous example)
## Stage 2: Nginx state for serving content
FROM nginx:alpine
# copy custom nginx configuration from host to container
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Set working directory to nginx asset directory
WORKDIR /usr/share/nginx/html
# Remove default nginx static assets
RUN rm -rf ./*
COPY --from=build . .
RUN chmod g+rwx /var/cache/nginx /var/run /var/log/nginx
ENTRYPOINT ["nginx", "-g", "daemon off;"]
Resulted in Internal Server errors
Describe the task Dockerizing the front end allows developers to more easily run NRPTI locally, creates a more consistent local instance
Acceptance Criteria
Additional context