This repository has been archived by the owner on Jun 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
62 lines (51 loc) · 1.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
FROM ubuntu:bionic
WORKDIR /apps
RUN apt-get update && apt-get upgrade -y
#install dependencies
RUN apt-get update && apt-get install -y \
wget lsb-release openjdk-8-jre software-properties-common gnupg
#add repositories
#add mysql-ppa (ubuntu ppa provides only mysql 5.7)
RUN wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb && \
DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.8.15-1_all.deb && \
#add elasticsearch-ppa
wget https://packages.elastic.co/GPG-KEY-elasticsearch && \
apt-key add GPG-KEY-elasticsearch && \
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | \
tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list && \
#add ondrej-ppa for php 7.4
add-apt-repository ppa:ondrej/php
#install services
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
supervisor mysql-server elasticsearch apache2 memcached libmemcached-tools \
php7.4 libapache2-mod-php7.4 php-memcached php7.4-cli
#cleanup
RUN rm GPG-KEY-elasticsearch && \
rm mysql-apt-config_0.8.15-1_all.deb && \
apt-get purge -y wget
#manage configs
COPY configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY configs/php.ini /etc/php/7.4/apache2/php.ini
COPY configs/memcached.conf /etc/memcached.conf
COPY configs/apache2.conf /etc/apache2/apache2.conf
#manage data
RUN ln -s /var/www/html/ document_root && \
ln -s /var/lib/mysql/ mysql
#prepare db
ENV DB_NAME db
ENV DB_ADMIN_USER admin
ENV DB_ADMIN_PASSWORD admin
ENV DB_ROOT_PASSWORD root
COPY db_setup.sql db_setup.sql
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
#mysql
EXPOSE 3306
#elasticsearch
EXPOSE 9200
#apache2
EXPOSE 80
#memcached
EXPOSE 11211
CMD ["/usr/bin/supervisord"]