This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
/
Dockerfile
94 lines (82 loc) · 2.57 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
83
84
85
86
87
88
89
90
91
92
93
94
# Docker Container for Atmosphere
FROM ubuntu:18.04
# Set environment
SHELL ["/bin/bash", "-c"]
# Install dependencies with apt
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
apt-transport-https \
build-essential \
git \
g++ \
libffi-dev \
libguestfs-tools \
libldap2-dev \
libpq-dev \
libsasl2-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
locales \
make \
netcat \
openssl \
postgresql-client \
python \
python-dev \
python-m2crypto \
python-pip \
python-psycopg2 \
python-setuptools \
python-tk \
redis-server \
sendmail \
ssh \
sudo \
swig \
ufw \
uwsgi \
uwsgi-plugin-python \
wget \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/* && \
locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Create PID and log directories for uWSGI
RUN mkdir -p /run/uwsgi/app/atmosphere /var/log/uwsgi && \
chown -R www-data:www-data /run/uwsgi/app/ /var/log/uwsgi && \
touch /var/log/uwsgi/atmosphere.log
# Clone repos and pip install requirements
RUN mkdir /opt/env && \
pip install --upgrade pip==9.0.3 virtualenv &&\
virtualenv /opt/env/atmosphere &&\
ln -s /opt/env/atmosphere/ /opt/env/atmo
RUN git clone --depth 1 https://github.com/cyverse/atmosphere-ansible.git /opt/dev/atmosphere-ansible
COPY . /opt/dev/atmosphere
WORKDIR /opt/dev/atmosphere
# Install initd files
RUN cp docker/flower.initd /etc/init.d/flower && \
cp docker/celeryd.initd /etc/init.d/celeryd && \
cp docker/celerybeat.initd /etc/init.d/celerybeat && \
chmod -R 755 /etc/init.d
# Setup uwsgi
RUN mkdir -p /etc/uwsgi/apps-available /etc/uwsgi/apps-enabled && \
cp docker/uwsgi.ini /etc/uwsgi/apps-available/atmosphere.ini && \
ln -s /etc/uwsgi/apps-available/atmosphere.ini /etc/uwsgi/apps-enabled/atmosphere.ini
RUN source /opt/env/atmo/bin/activate && pip install -r requirements.txt
# Cleanup
RUN apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
RUN useradd user
# Prepare entrypoint
RUN cp docker/web_shell_no_gateone.yml /opt/web_shell_no_gateone.yml && \
mkdir -p /root/.ssh && \
cp docker/ssh.config /root/.ssh/config && \
cp docker/entrypoint.sh /root/entrypoint.sh && \
cp docker/test.sh /root/test.sh && \
chmod +x /root/entrypoint.sh && \
chmod +x /root/test.sh && \
echo "source /opt/env/atmo/bin/activate" >> /root/.bashrc
ENTRYPOINT ["/root/entrypoint.sh"]