-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
41 lines (31 loc) · 1.07 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
FROM centos:latest
MAINTAINER Beshoy Girgis <[email protected]>
# Set up ansible
RUN yum clean all && \
yum -y install epel-release && \
yum -y install PyYAML python-jinja2 python-httplib2 python-keyczar python-paramiko python-setuptools git python-pip
RUN mkdir /etc/ansible/
RUN echo -e '[local]\nlocalhost' > /etc/ansible/hosts
RUN pip install ansible
# Add the ansible playbook
ADD ansible /srv/server
# Run the playbooks
RUN ansible-playbook /srv/server/server.yml -c local
# Slim down the container
RUN yum clean all
# forward nginx and php-fpm request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
RUN ln -sf /dev/stderr /var/log/php-fpm/error.log
RUN ln -sf /dev/stderr /var/log/php-fpm/www-error.log
RUN ln -sf /dev/stderr /var/log/php-fpm/www-slow.log
# Create site directory and set it as the default
RUN mkdir /site
WORKDIR /site
# expose ports
EXPOSE 80
# Add startup script
ADD ./start.sh /start.sh
RUN chmod 755 /start.sh
# Execute start script
CMD ["/bin/bash", "/start.sh"]