-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
117 lines (94 loc) · 3.93 KB
/
Copy pathDockerfile
File metadata and controls
117 lines (94 loc) · 3.93 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
##########################################################################
# Ruggedy Docker Container #
# Author: Ruggedy.io #
# Version 0.1 Beta #
##########################################################################
FROM ubuntu:16.04
MAINTAINER Ruggedy <hello@ruggedy.io>
##########################################################################
# Initial Server and Environment Settings #
##########################################################################
RUN DEBIAN_FRONTEND=noninteractive
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LC_CTYPE=UTF-8
ENV LANG=en_US.UTF-8
ENV TERM xterm
##########################################################################
# Repositories #
##########################################################################
RUN apt-get update
RUN apt-get upgrade -y --force-yes
RUN apt-get install -y --force-yes \
software-properties-common\
supervisor \
php7.0-cli \
php7.0-common \
php7.0-curl \
php7.0-json \
php7.0-xml \
php7.0-mbstring \
php7.0-mcrypt \
php7.0-mysql \
php7.0-zip \
php7.0-gd \
php7.0-soap \
git \
curl \
vim \
nano \
nodejs \
zip \
unzip \
npm \
nginx \
php7.0-fpm
##########################################################################
# Configure Supervisor #
##########################################################################
RUN mkdir -p /var/log/supervisor
COPY docker-files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
VOLUME ["/var/log/supervisor"]
##########################################################################
# Configure PHP-FPM and NGINX DAEMON #
##########################################################################
RUN sed -i 's/;daemonize = yes/daemonize = no/g' /etc/php/7.0/fpm/php-fpm.conf
RUN sed -i '1s/^/daemon off;\n/' /etc/nginx/nginx.conf
RUN mkdir /run/php
RUN rm /etc/php/7.0/fpm/php.ini
COPY docker-files/php.ini /etc/php/7.0/fpm/
RUN rm /etc/nginx/sites-available/default
RUN rm /etc/nginx/sites-enabled/default
COPY docker-files/default /etc/nginx/sites-available/
RUN ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
COPY docker-files/nginx.conf /etc/nginx/
##########################################################################
# Configure Composer #
##########################################################################
RUN curl -sS https://getcomposer.org/installer | php \
-- --install-dir=/usr/local/bin --filename=composer
##########################################################################
# Setup and Configure Ruggedy App #
##########################################################################
WORKDIR /usr/share/nginx/html/
RUN mkdir ruggedy-vma
COPY docker-files/.env /usr/share/nginx/html/ruggedy-vma
WORKDIR /usr/share/nginx/html/ruggedy-vma
RUN npm install -g \
bower
COPY package.json /usr/share/nginx/html/ruggedy-vma
RUN npm link gulp
RUN ln -s /usr/bin/nodejs /usr/bin/node
WORKDIR /usr/share/nginx/html
RUN chown -R www-data:www-data ./ruggedy-vma
RUN find /usr/share/nginx/html/ruggedy-vma -type d -exec chmod 755 {} \;
VOLUME ["/usr/share/nginx/html"]
##########################################################################
# Install and start the cron #
##########################################################################
COPY docker-files/crontab /etc/cron.d/ruggedy-cron
RUN chmod 0600 /etc/cron.d/ruggedy-cron
RUN touch /var/log/cron.log
RUN crontab /etc/cron.d/ruggedy-cron
CMD ["/usr/bin/supervisord"]
EXPOSE 80