forked from orangehrm/orangehrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (42 loc) · 1.68 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
FROM ubuntu:14.04
MAINTAINER Orangehrm <[email protected]>
RUN apt-get update
# Install apache, PHP, and supplimentary programs. curl is for debugging the container.
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 mysql-server libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl curl supervisor
# Enable apache mods.
RUN a2enmod php5
RUN a2enmod rewrite
# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ARG SEED=true
# Export port 80
EXPOSE 80
# add source to image
RUN mkdir -p var/www/site/orangehrm
COPY . var/www/site/orangehrm
#config mysql
RUN /usr/sbin/mysqld & \
sleep 5s &&\
echo "USE mysql;\nUPDATE user SET password=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql
# Fix Permission
RUN cd var/www/site/orangehrm; bash fix_permissions.sh
#install application
RUN /usr/sbin/mysqld & \
sleep 5s &&\
cd var/www/site/orangehrm; php installer/cli_install.php 0
#Seed the database
RUN /usr/sbin/mysqld & \
sleep 5s &&\
cd var/www/site/orangehrm/travis-config-files; ./seeddb.sh
# Update the default apache site with the config we created.
ADD docker-build-files/apache-config.conf /etc/apache2/sites-enabled/000-default.conf
# Update the default apache ports with the config we created.
ADD docker-build-files/ports.conf /etc/apache2/ports.conf
# Copy Supervisor configuration
ADD docker-build-files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Start apache/mysql
CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf