Skip to content

Commit 4be940d

Browse files
committed
Updated scripts.
1 parent bb0c8f3 commit 4be940d

File tree

6 files changed

+65
-56
lines changed

6 files changed

+65
-56
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
config/
2+
scripts/
3+
.gitignore
4+
docker-test.sh
5+
README.md

.gitignore

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
### OSX
2-
3-
.DS_Store
1+
### Mac
42
._*
3+
.DS_Store
4+
.Spotlight-V100
5+
.Trashes
56

6-
### IDE
7-
7+
### Intellij
88
.idea/
9-
*.iml
9+
*.iml
10+
*.iws

Dockerfile

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,50 @@ FROM ubuntu:14.04
22
MAINTAINER Sukru Uzel <uzelsukru@gmail.com>
33

44
# Keep upstart
5-
RUN dpkg-divert --local --rename --add /sbin/initctl
6-
RUN ln -sf /bin/true /sbin/initctl
5+
RUN dpkg-divert --local --rename --add /sbin/initctl && ln -sf /bin/true /sbin/initctl
76

87
# Set no tty
98
ENV DEBIAN_FRONTEND noninteractive
10-
ENV MYSQL_DB processwire
11-
ENV MYSQL_USER processwire
12-
ENV MYSQL_PASS processwire
9+
ENV MYSQL_DB pw_db
10+
ENV MYSQL_USER pw_user
11+
ENV MYSQL_PASS pw_pass
1312

1413
# Update System
15-
RUN apt-get update
16-
RUN apt-get -y upgrade
14+
RUN apt-get update && apt-get -y upgrade
1715

1816
# Basic Requirements
1917
RUN apt-get install -y pwgen --force-yes python-setuptools curl git unzip \
20-
mysql-server mysql-client \
21-
nginx \
22-
php5-fpm php5-mysql php-apc php5-cli php5-curl php5-gd php5-mcrypt php5-intl \
23-
php5-imap php5-tidy php5-imagick php5-memcache php5-xmlrpc php5-xsl
18+
mysql-server mysql-client \
19+
nginx \
20+
php5-fpm php5-mysql php-apc php5-cli php5-curl php5-gd php5-mcrypt php5-intl \
21+
php5-imap php5-tidy php5-imagick php5-memcache php5-xmlrpc php5-xsl
2422

2523
# MySQL Config
2624
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
2725

2826
# Nginx Config
29-
RUN sed -i -e"s/keepalive_timeout\s*65/keepalive_timeout 2/" /etc/nginx/nginx.conf
30-
RUN sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\tclient_max_body_size 100m/" /etc/nginx/nginx.conf
31-
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
27+
RUN sed -i -e"s/keepalive_timeout\s*65/keepalive_timeout 2/" /etc/nginx/nginx.conf && \
28+
sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\tclient_max_body_size 100m/" /etc/nginx/nginx.conf && \
29+
echo "daemon off;" >> /etc/nginx/nginx.conf
3230
ADD ./config/nginx-site.conf /etc/nginx/sites-available/default
3331

3432
# PHP Config
35-
RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini
36-
RUN sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php5/fpm/php.ini
37-
RUN sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php5/fpm/php.ini
38-
RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf
39-
RUN sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" /etc/php5/fpm/pool.d/www.conf
40-
RUN find /etc/php5/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \;
33+
RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini && \
34+
sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php5/fpm/php.ini && \
35+
sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php5/fpm/php.ini && \
36+
sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf && \
37+
sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" /etc/php5/fpm/pool.d/www.conf && \
38+
find /etc/php5/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \;
4139

4240
# ProcessWire Install
43-
RUN git clone git://github.com/ryancramerdesign/ProcessWire.git -b master
44-
RUN cd ProcessWire/ && rm -rf .git
41+
RUN git clone git://github.com/ryancramerdesign/ProcessWire.git -b master && cd ProcessWire/ && rm -rf .git
4542

4643
# Supervisor Config
4744
RUN easy_install supervisor
4845
ADD ./config/supervisord.conf /etc/supervisord.conf
4946

5047
# Volume
51-
VOLUME ["/usr/share/nginx"]
48+
VOLUME ["/var/lib/mysql", "/usr/share/nginx"]
5249

5350
# Expose
5451
EXPOSE 80

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Docker ProcessWire
1+
# ProcessWire (Docker Image)
22

33
[![Go to Docker Hub](https://img.shields.io/badge/Docker%20Hub-%E2%86%92-blue.svg)](https://hub.docker.com/r/suzel/docker-processwire/)
44

@@ -12,7 +12,7 @@ The easiest way to get this docker image installed is to pull the latest version
1212
$ docker pull suzel/docker-processwire
1313
```
1414

15-
Build the docker-processwire:
15+
or build from scratch:
1616

1717
```sh
1818
$ git clone https://github.com/suzel/docker-processwire.git
@@ -27,15 +27,20 @@ Start your image binding external port 80 in all interfaces to your container:
2727
```sh
2828
$ docker run --name webproject \
2929
-v $PWD:/usr/share/nginx \
30-
-p 80:80 -p 3306:3306 \
31-
-e MYSQL_DB=processwire \
32-
-e MYSQL_USER=processwire \
33-
-e MYSQL_PASS=processwire \
30+
-p 80:80 \
31+
-p 3306:3306 \
32+
-e MYSQL_DB=pw_db \
33+
-e MYSQL_USER=pw_user \
34+
-e MYSQL_PASS=pw_pass \
3435
-d suzel/docker-processwire
3536
```
3637

3738
You can the visit the following URL in a browser on your host machine to get started:
3839

3940
```
40-
open http://$(docker-machine ip default):80
41-
```
41+
open http://$(docker-machine ip default)
42+
```
43+
44+
## Documentation
45+
46+
* [ProcessWire Documentation](https://processwire.com/docs/)

docker-test.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
docker-machine start default
4+
eval "$(docker-machine env default)"
5+
6+
docker build -t suzel/docker-processwire .
7+
8+
docker stop webproject && docker rm webproject
9+
10+
docker run --name webproject \
11+
-v $PWD:/usr/share/nginx \
12+
-p 80:80 \
13+
-p 3306:3306 \
14+
-e MYSQL_DB=pw_db \
15+
-e MYSQL_USER=pw_user \
16+
-e MYSQL_PASS=pw_pass \
17+
-d suzel/docker-processwire
18+
19+
open http://$(docker-machine ip default)
20+
docker exec -it webproject bash

test.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)