소스 검색

added docker files

tags/v1.0.0
Robin Thoni 6 년 전
부모
커밋
e465758c4d
3개의 변경된 파일98개의 추가작업 그리고 0개의 파일을 삭제
  1. 29
    0
      apache/Dockerfile
  2. 60
    0
      apache/config/apache2.conf
  3. 9
    0
      docker-compose.yml

+ 29
- 0
apache/Dockerfile 파일 보기

@@ -0,0 +1,29 @@
1
+FROM robinthoni/debian-multiarch:jessie
2
+
3
+# FROM https://github.com/ZHAJOR/Docker-Apache-2.4-Php-5.6-for-Laravel
4
+MAINTAINER Robin Thoni <robin@rthoni.com>
5
+
6
+RUN apt-get update && apt-get -y install\
7
+        apache2=2.4.*\
8
+        libapache2-mod-php5\
9
+        php5 &&\
10
+        apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11
+
12
+RUN /usr/sbin/a2enmod rewrite &&\
13
+    rm -rf /var/www/html &&\
14
+    mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
15
+    chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
16
+
17
+RUN rm -rf /var/log/* &&\
18
+    mkdir -p /var/log/apache2 &&\
19
+    ln -s /dev/stderr /var/log/apache2/error.log &&\
20
+    ln -s /dev/stdout /var/log/apache2/access.log &&\
21
+    ln -s /dev/stdout /var/log/apache2/other_vhosts_access.log
22
+
23
+COPY ./config/apache2.conf /etc/apache2/apache2.conf
24
+
25
+COPY ./wwwroot/ /var/www/html/
26
+
27
+EXPOSE 80
28
+
29
+CMD "/usr/sbin/apache2ctl" "-D" "FOREGROUND"

+ 60
- 0
apache/config/apache2.conf 파일 보기

@@ -0,0 +1,60 @@
1
+# see http://sources.debian.net/src/apache2/2.4.10-1/debian/config-dir/apache2.conf
2
+
3
+ServerName www.rthoni.com
4
+Mutex file:/var/lock/apache2 default
5
+PidFile /var/run/apache2/apache2.pid
6
+Timeout 300
7
+KeepAlive On
8
+MaxKeepAliveRequests 100
9
+KeepAliveTimeout 5
10
+User www-data
11
+Group www-data
12
+HostnameLookups Off
13
+ErrorLog /var/log/apache2/error.log
14
+LogLevel warn
15
+
16
+IncludeOptional mods-enabled/*.load
17
+IncludeOptional mods-enabled/*.conf
18
+
19
+# ports.conf
20
+Listen 80
21
+<IfModule ssl_module>
22
+    Listen 443
23
+</IfModule>
24
+<IfModule mod_gnutls.c>
25
+    Listen 443
26
+</IfModule>
27
+
28
+DocumentRoot "/var/www/html/"
29
+
30
+<Directory />
31
+    Options FollowSymLinks
32
+    AllowOverride None
33
+    Require all denied
34
+</Directory>
35
+
36
+<Directory /var/www/html/>
37
+    Options FollowSymLinks
38
+    AllowOverride All
39
+    Require all granted
40
+</Directory>
41
+
42
+
43
+
44
+LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
45
+LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
46
+LogFormat "%h %l %u %t \"%r\" %>s %O" common
47
+LogFormat "%{Referer}i -> %U" referer
48
+LogFormat "%{User-agent}i" agent
49
+
50
+CustomLog /var/log/apache2/access.log combined
51
+
52
+<FilesMatch \.php$>
53
+    SetHandler application/x-httpd-php
54
+</FilesMatch>
55
+
56
+# Multiple DirectoryIndex directives within the same context will add
57
+# to the list of resources to look for rather than replace
58
+# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
59
+DirectoryIndex disabled
60
+DirectoryIndex index.php index.html

+ 9
- 0
docker-compose.yml 파일 보기

@@ -0,0 +1,9 @@
1
+version: '2'
2
+
3
+services:
4
+    apache:
5
+        build: ./apache
6
+        container_name: www.rthoni.com-apache
7
+#        restart: unless-stopped
8
+        ports:
9
+            - "127.0.0.1:35030:80"

Loading…
취소
저장