forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Singularity.ui
66 lines (54 loc) · 1.49 KB
/
Singularity.ui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Bootstrap: docker
From: ubuntu:18.04
# This container used to be a multistage bulid, but Singularity doesn't
# easily support that.
%files
./cvat-core /tmp/cvat-core
./cvat-canvas /tmp/cvat-canvas
./cvat-ui /tmp/cvat-ui
%environment
#IMPORTANT make sure to edit these also in %post
export http_proxy=
export https_proxy=
export no_proxy=
export socks_proxy=
export REACT_APP_API_PROTOCOL=http
export REACT_APP_API_HOST=localhost
export REACT_APP_API_PORT=8080
export TERM=xterm
export LANG='C.UTF-8'
export LC_ALL='C.UTF-8'
%post
export http_proxy=
export https_proxy=
export no_proxy=
export socks_proxy=
export REACT_APP_API_PROTOCOL=http
export REACT_APP_API_HOST=localhost
export REACT_APP_API_PORT=8080
export TERM=xterm
export LANG='C.UTF-8'
export LC_ALL='C.UTF-8'
# Install necessary apt packages
apt update && apt install -yq nodejs npm curl tree nginx && \
npm install -g n && n 10.16.3
# Create output directories
mkdir -p /tmp/cvat-ui /tmp/cvat-core /tmp/cvat-canvas
# Install cvat-core dependencies
cd /tmp/cvat-core/
npm install
# Install cvat-canvas dependencies
cd /tmp/cvat-canvas/
npm install
# Install cvat-ui dependencies
cd /tmp/cvat-ui/
npm install
npm run build
echo "Contents of /tmp"
tree /tmp | grep cvat-ui
# Replace default.conf configuration to remove unnecessary rules
# Note from @vsoch - I don't think this default.conf is being used
cp /tmp/cvat-ui/react_nginx.conf /etc/nginx/conf.d/default.conf
cp /tmp/cvat-ui/dist/* /var/www/html/
%startscript
exec nginx -g "daemon off;"