-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
91 lines (81 loc) · 3.44 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
FROM ubuntu:bionic
LABEL org.label-schema.name="Jano Ticketing System" \
maintainer="Andrew Ying <hi@andrewying.com>" \
org.label-schema.description="Official Docker image for the Jano Ticketing System" \
org.label-schema.vcs-url="https://github.com/jano-may-ball/ticketing" \
org.label-schema.schema-version="1.0"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils curl gnupg wget software-properties-common
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& add-apt-repository ppa:ondrej/php
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
vim \
htop \
mariadb-server \
redis-server \
supervisor \
openssl \
openssh-server \
apache2 \
apache2-bin \
apache2-data \
apache2-utils \
libapache2-mod-php7.1 \
php7.1 \
php7.1-xdebug \
php7.1-mysql \
php7.1-redis \
php7.1-mbstring \
php7.1-tokenizer \
php7.1-bcmath \
php7.1-gd \
php7.1-xml \
php7.1-curl \
php7.1-zip \
php7.1-bz2 \
unzip \
nodejs \
sudo
RUN a2enmod rewrite
RUN sed -ie 's/upload_max_filesize\ =\ 2M/upload_max_filesize\ =\ 200M/g' /etc/php/7.1/apache2/php.ini \
&& sed -ie 's/post_max_size\ =\ 8M/post_max_size\ =\ 200M/g' /etc/php/7.1/apache2/php.ini \
&& sed -ie 's/bind/# bind/g' /etc/redis/redis.conf \
&& sed -ie 's/daemonize yes/daemonize no/g' /etc/redis/redis.conf
ARG ROOT_PASSWORD=password
RUN set -xe; \
bash -c "mysqld_safe --user=mysql &"; \
sleep 10; \
echo "GRANT ALL ON *.* TO root@'localhost' IDENTIFIED BY '$ROOT_PASSWORD' WITH GRANT OPTION; FLUSH PRIVILEGES" | mysql; \
echo "CREATE DATABASE jano" | mysql -u root -p"$ROOT_PASSWORD"
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apt-get clean \
&& rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* /root/.composer /var/www/jano/node_modules
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY .codeship /var/www/codeship
RUN chmod +x /var/www/codeship/*
COPY . /var/www/jano
WORKDIR /var/www/jano
ARG BUILD_ENV=development
RUN chown -R www-data:www-data /var/www/jano \
&& if [ "$BUILD_ENV" = "development" ]; \
then HOME=/var/www/jano sudo -u www-data composer install --prefer-source --no-interaction \
&& curl https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash; \
else HOME=/var/www/jano sudo -u www-data composer install --prefer-source --no-dev --no-interaction; \
fi \
&& sudo -u www-data openssl genpkey -algorithm RSA -out storage/oauth-private.key -pkeyopt rsa_keygen_bits:2048 \
&& sudo -u www-data openssl rsa -in storage/oauth-private.key -outform PEM -pubout -out storage/oauth-public.key \
&& HOME=/var/www/jano sudo -u www-data npm install \
&& if [ "$BUILD_ENV" = "development" ]; \
then HOME=/var/www/jano sudo -u www-data npm run development; \
else HOME=/var/www/jano sudo -u www-data npm run production; \
fi
RUN rm -rf /var/www/html \
&& ln -s /var/www/jano/public /var/www/html
RUN set -xe; \
bash -c "mysqld --user=mysql &"; \
sleep 20; \
sudo -u www-data php jano migrate --seed --force
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]