FROM registry.yandex.net/ubuntu:bionic

RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get update && apt-get install build-essential nodejs nginx python -y
COPY build/package.json /build/package.json
RUN cd /build && npm --registry=https://npm.yandex-team.ru i
COPY build /build
COPY lib /lib
RUN cd /build && npm run build

ENV ROOT "/crypta/lab"

WORKDIR ${ROOT}
RUN cp -r /build/build/* .
RUN cp /build/nginx.conf /etc/nginx/nginx.conf
RUN cp /build/security.headers.conf /etc/nginx/security.headers.conf
RUN cp /build/entrypoint.sh .

EXPOSE 80

CMD ["./entrypoint.sh"]
