You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
XML
54 lines
1.2 KiB
XML
FROM ubuntu:18.04 AS cvat-ui
|
|
|
|
ARG http_proxy
|
|
ARG https_proxy
|
|
ARG no_proxy
|
|
ARG socks_proxy
|
|
ARG REACT_APP_API_PORT
|
|
ARG REACT_APP_API_PROTOCOL
|
|
ARG REACT_APP_API_HOST
|
|
|
|
ENV TERM=xterm \
|
|
http_proxy=${http_proxy} \
|
|
https_proxy=${https_proxy} \
|
|
no_proxy=${no_proxy} \
|
|
socks_proxy=${socks_proxy}
|
|
|
|
ENV LANG='C.UTF-8' \
|
|
LC_ALL='C.UTF-8'
|
|
|
|
# Install necessary apt packages
|
|
RUN apt update && apt install -yq nodejs npm curl && \
|
|
npm install -g n && n 10.16.3
|
|
|
|
# Create output directories
|
|
RUN mkdir /tmp/cvat-ui /tmp/cvat-core /tmp/cvat-canvas
|
|
|
|
# Install dependencies
|
|
COPY cvat-core/package*.json /tmp/cvat-core/
|
|
COPY cvat-canvas/package*.json /tmp/cvat-canvas/
|
|
COPY cvat-ui/package*.json /tmp/cvat-ui/
|
|
|
|
# Install cvat-core dependencies
|
|
WORKDIR /tmp/cvat-core/
|
|
RUN npm install
|
|
|
|
# Install cvat-canvas dependencies
|
|
WORKDIR /tmp/cvat-canvas/
|
|
RUN npm install
|
|
|
|
# Install cvat-ui dependencies
|
|
WORKDIR /tmp/cvat-ui/
|
|
RUN npm install
|
|
|
|
# Build source code
|
|
COPY cvat-core/ /tmp/cvat-core/
|
|
COPY cvat-canvas/ /tmp/cvat-canvas/
|
|
COPY cvat-ui/ /tmp/cvat-ui/
|
|
RUN npm run build
|
|
|
|
FROM nginx
|
|
# Replace default.conf configuration to remove unnecessary rules
|
|
COPY cvat-ui/react_nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=cvat-ui /tmp/cvat-ui/dist /usr/share/nginx/html/
|