-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
101 lines (83 loc) · 2.69 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
95
96
97
98
99
100
101
FROM ubuntu:16.04
# initialize .ssh directory
RUN mkdir -p ~/.ssh \
&& chmod 700 ~/.ssh \
&& touch ~/.ssh/authorized_keys \
&& chmod 600 ~/.ssh/authorized_keys
# intsall Ubuntu packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& export LC_ALL=en_US.UTF-8 \
&& apt-get update \
&& apt-get install -y --allow-unauthenticated \
apt-utils \
curl \
g++ \
gettext \
git \
imagemagick \
language-pack-en-base \
make \
mysql-client \
mysql-server \
nginx \
openssh-server \
postfix \
python \
python-software-properties \
ruby-compass \
ruby-dev \
screen \
software-properties-common \
sudo \
tmux \
vim \
&& add-apt-repository -y ppa:ondrej/php \
&& add-apt-repository ppa:certbot/certbot \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash \
# && apt-get update \ # above calls apt-get update
&& apt-get install -y --allow-unauthenticated --no-install-recommends \
certbot python3-pyasn1 \
nodejs \
php-apcu \
php5.6-cli \
php5.6-curl \
php5.6-fpm \
php5.6-gd \
php5.6-imagick \
php5.6-intl \
php5.6-json \
php5.6-mbstring \
php5.6-mysql \
php5.6-xml \
&& rm -rf /var/lib/apt/lists/*
# disable built-in services for emergence
RUN service nginx stop \
&& service php5.6-fpm stop \
&& service mysql stop \
&& service apparmor stop \
&& update-rc.d -f nginx disable \
&& update-rc.d -f php5.6-fpm disable \
&& update-rc.d -f mysql disable \
&& update-rc.d -f apparmor disable
# install Habitat client and packages for emergence
RUN curl -s https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | bash -s -- -v 0.79.0
RUN hab pkg install jarvus/sencha-cmd/6.5.2.15 jarvus/underscore \
&& hab pkg binlink jarvus/sencha-cmd sencha \
&& hab pkg binlink jarvus/underscore underscore
# install helpful administrative commands
RUN npm install -g htpasswd
# install emergence
COPY . /src
RUN npm install -g /src
# link certbot renewal hook to reload nginx
RUN mkdir -p /etc/letsencrypt/renewal-hooks/deploy \
&& ln -s /src/bin/reload-nginx /etc/letsencrypt/renewal-hooks/deploy/01-reload-nginx
# setup and expose emergence
RUN mkdir -p /emergence
EXPOSE 22 80 3306 9083
ENV MYSQL_HOME=/emergence/services/etc
VOLUME ["/emergence", "/etc/letsencrypt"]
# setup entrypoint
RUN echo '#!/bin/bash\nrm /emergence/kernel.sock /emergence/services/run/*/*\nexec emergence-kernel' > /entrypoint.sh \
&& chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]