-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (42 loc) · 1.36 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (42 loc) · 1.36 KB
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
FROM ubuntu:14.04
Maintainer Luis Elizondo "lelizondo@gmail.com"
ENV DEBIAN_FRONTEND noninteractive
# Update system
RUN apt-get update && apt-get dist-upgrade -y
# Ensure UTF-8
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Install PHP
RUN apt-get -y install php5-fpm php5-mysql php-apc php5-imap php5-mcrypt php5-curl php5-cli php5-gd php5-common php-pear curl php5-json
# Install Nginx
RUN apt-get -y install nginx
# Install MySQL
RUN apt-get -y install mysql-client mysql-server
# Install pwgen
RUN apt-get -y install pwgen
# Prevent daemon start during install
RUN echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d
# Install Supervisor
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
# Add Nginx file
ADD ./config/default /etc/nginx/sites-available/default
# Cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
###
### Configurations
###
# Add start.sh
ADD ./config/start.sh /start.sh
RUN chmod +x /start.sh
# Supervisor starts everything
ADD ./config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Configure MySQL
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
# Configure PHP RPM
RUN sed -i 's/memory_limit = .*/memory_limit = 196M/' /etc/php5/fpm/php.ini
EXPOSE 80
EXPOSE 3306
# Supervisord
CMD ["/start.sh"]