Docker

If you don't want to pollute your machine with extra project or if you have problems running the app you can use a docker image (make sure is configured on the project).

Before go ahead, you have to install Docker on you system.

Docker for localhost development

  • Open terminal in root project folder.

  • run npm run docker-up. this will startup server. As you will close terminal, server will shutdown.

  • Open a new terminal and run npm run docker-exec, now you are in the docker machine, you can run any commands like npm run start

Docker for deployment / CI

We are using a docker image to deploy Nagase on both Heroku and IBM cloud. the docker file is this one

FROM node:12 as build-stage

ARG ENV_BUILD=remote-development

ADD package*.json /app/

WORKDIR /app

RUN npm install

COPY . /app

RUN npm run build:${ENV_BUILD}

FROM nginx:alpine AS base
WORKDIR /
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/change_configuration.sh /change_configuration.sh

## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*

COPY --from=build-stage  /app/dist/ /usr/share/nginx/html/
RUN chmod +x /change_configuration.sh

# Add bash
RUN apk add --no-cache bash

CMD ["/bin/bash", "-c", " /change_configuration.sh && nginx -g \"daemon off;\""]

Last updated

Was this helpful?