952 days continuous production uptime, 40k+ tp/s single node. Original corpo Bitbucket history not included — clean archive commit.
111 lines
3.7 KiB
Docker
111 lines
3.7 KiB
Docker
# docker build . --tag=givingassistant/namaste:master
|
|
# FROM givingassistant/base:latest
|
|
FROM ubuntu:18.04
|
|
# install PHP and required packages, config
|
|
RUN adduser --system --no-create-home --group app && \
|
|
adduser app www-data && \
|
|
export DEBIAN_FRONTEND=noninteractive && \
|
|
apt-get update && \
|
|
apt-get upgrade -y && \
|
|
apt-get install -y software-properties-common \
|
|
build-essential \
|
|
locales \
|
|
&& \
|
|
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
|
|
add-apt-repository ppa:ondrej/php && \
|
|
apt-get update && \
|
|
apt-get install -y php7.2 \
|
|
php7.2-common \
|
|
php7.2-bcmath \
|
|
php7.2-cli \
|
|
php7.2-curl \
|
|
php7.2-dev \
|
|
php7.2-gd \
|
|
php7.2-json \
|
|
php7.2-mbstring \
|
|
php7.2-mysql \
|
|
php7.2-opcache \
|
|
php7.2-readline \
|
|
php7.2-xml \
|
|
php7.2-memcached \
|
|
# php7.3-mongodb \
|
|
php-pear \
|
|
autoconf \
|
|
g++ \
|
|
make \
|
|
libcurl4-openssl-dev \
|
|
pkg-config \
|
|
libsasl2-dev \
|
|
libpcre3-dev \
|
|
openssl \
|
|
libssl-dev \
|
|
openssh-server \
|
|
wget \
|
|
rsync \
|
|
git \
|
|
zip \
|
|
apache2 \
|
|
mongodb \
|
|
mariadb-client \
|
|
iputils-ping \
|
|
dnsutils \
|
|
vim && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN echo "America/Los_Angeles" > /etc/timezone && \
|
|
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
|
|
# Should we use configure tzdata instead commands instead of pushing into /etc/timezone.
|
|
|
|
ENV LANG en_US.utf8
|
|
|
|
# This needs to be in a different run command for some reason
|
|
# otherwise we are getting log directory does not exist error.
|
|
# install mongodb
|
|
RUN pecl install mongodb && \
|
|
pecl clear-cache
|
|
# PHP configuration
|
|
ADD ./deployment/phpconf.ini /etc/php/7.2/cli/conf.d/90-givva.ini
|
|
# install app requirements
|
|
RUN mkdir -p /home/app/lib
|
|
|
|
ADD lib/composer.json /home/app/lib/composer.json
|
|
RUN wget https://getcomposer.org/composer.phar && \
|
|
chmod +x composer.phar && \
|
|
mv composer.phar /usr/local/bin/composer && \
|
|
cd /home/app/lib && \
|
|
/usr/local/bin/composer update -vv --prefer-dist
|
|
# add apache config
|
|
ADD ./deployment/apache.conf /etc/apache2/sites-available/namaste.conf
|
|
# TODO should we add ssl files like we do on givingassistant/web ?
|
|
RUN a2ensite namaste && \
|
|
a2dissite 000-default && \
|
|
a2enmod ssl && \
|
|
a2enmod headers && \
|
|
a2enmod rewrite && \
|
|
a2enmod setenvif && \
|
|
a2enmod status
|
|
# Add run script
|
|
# ADD ./deployment/run_apache.sh /etc/service/httpd/run
|
|
# ADD ./deployment/run_namaste.sh /etc/my_init.d/02_namaste_start.sh
|
|
ADD ./deployment/run.sh /sbin/run.sh
|
|
# pull in source to user's home
|
|
ADD . /home/app
|
|
|
|
RUN mkdir -p /home/app/logs && \
|
|
mkdir -p /home/app/pids && \
|
|
mkdir -p /home/app/scripts/mongo && \
|
|
chmod a+x /sbin/run.sh &&\
|
|
chown app /home/app -R && \
|
|
chgrp www-data /home/app -R && \
|
|
chmod g+rwx /home/app -R ;
|
|
|
|
# Add ssh configuration
|
|
ADD ./deployment/sshd/sshd_config /etc/ssh/sshd_config
|
|
ADD ./deployment/namastessh/id_rsa.pub /root/.ssh/authorized_keys
|
|
|
|
RUN passwd -d root
|
|
WORKDIR /home/app
|
|
|
|
CMD ["/sbin/run.sh"]
|