-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
82 lines (68 loc) · 2.79 KB
/
Dockerfile
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y curl build-essential software-properties-common ca-certificates gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
NODE_MAJOR=20 && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y python3 python3-venv python3-dev \
libpq-dev supervisor \
git nodejs postgresql-client vim nano screen htop \
libcurl4-gnutls-dev libgnutls28-dev && \
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
apt-get install -y cargo
ENV PATH="/root/.cargo/bin:${PATH}"
# we install nginx with brotli support from ppa:ondrej/nginx-mainline
RUN add-apt-repository ppa:ondrej/nginx-mainline -y && \
apt update -y && \
apt install -y nginx libnginx-mod-http-brotli-static libnginx-mod-http-brotli-filter
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
useradd --create-home --shell /bin/bash skyportal
RUN python3 -m venv /skyportal_env && \
\
bash -c "source /skyportal_env/bin/activate && \
pip install --upgrade pip==22.2.2 wheel numpy"
# install snid
RUN git clone https://github.com/Theodlz/snid-install-ubuntu.git && \
cd snid-install-ubuntu && chmod +x install.sh && bash ./install.sh
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ADD . /skyportal
WORKDIR /skyportal
RUN bash -c "\
cp docker.yaml config.yaml && \
\
source /skyportal_env/bin/activate && \
export NPM_CONFIG_LEGACY_PEER_DEPS=true && \
make system_setup && \
\
./node_modules/.bin/webpack --mode=production && \
rm -rf node_modules && \
\
chown -R skyportal.skyportal /skyportal_env && \
chown -R skyportal.skyportal /skyportal && \
\
mkdir -p /skyportal/static/thumbnails && \
chown -R skyportal.skyportal /skyportal/static/thumbnails && \
\
mkdir -p /skyportal/persistentdata/analysis && \
chown -R skyportal.skyportal /skyportal/persistentdata/analysis && \
\
mkdir -p /skyportal/persistentdata/dustmap && \
chown -R skyportal.skyportal /skyportal/persistentdata/dustmap && \
\
mkdir -p /skyportal/persistentdata/phot_series && \
chown -R skyportal.skyportal /skyportal/persistentdata/phot_series && \
\
mkdir -p /skyportal/persistentdata/sncosmo && \
chown -R skyportal.skyportal /skyportal/persistentdata/sncosmo"
ENV SNCOSMO_DATA_DIR=/skyportal/persistentdata/sncosmo
USER skyportal
EXPOSE 5000
CMD bash -c "source /skyportal_env/bin/activate && \
(make log &) && \
make run_production"