Skip to content

Commit 9e28e3f

Browse files
committed
Merge branch 'release/3.0.0'
# Conflicts: # README.md # docker/httpd/conf/vhost.conf
2 parents 058872e + 0bbede7 commit 9e28e3f

34 files changed

+589
-162
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
8+
[*]
9+
end_of_line = lf
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 4
13+
14+
[Makefile]
15+
indent_style = tab
16+
17+
[*.yml]
18+
indent_size = 2
19+
20+
[*.conf]
21+
indent_size = 2

Makefile

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
1+
ARGS = $(filter-out $@,$(MAKECMDGOALS))
2+
13
all: deploy
24

35
#############################
46
# Create new project
57
#############################
68

7-
create-cms-project:
8-
bash bin/create-project.sh cms
9-
10-
create-neos-project:
11-
bash bin/create-project.sh neos
12-
13-
create-symfony-project:
14-
bash bin/create-project.sh symfony
9+
create:
10+
bash bin/create-project.sh $(ARGS)
1511

1612
#############################
1713
# MySQL
1814
#############################
1915

2016
mysql-backup:
21-
docker-compose run --rm --no-deps main bash /docker/bin/backup.sh mysql
17+
docker-compose run --rm --no-deps main root bash /docker/bin/backup.sh mysql
2218

2319
mysql-restore:
24-
docker-compose run --rm --no-deps main bash /docker/bin/restore.sh mysql
20+
docker-compose run --rm --no-deps main root bash /docker/bin/restore.sh mysql
2521

2622
#############################
2723
# Solr
2824
#############################
2925

3026
solr-backup:
3127
docker-compose stop solr
32-
docker-compose run --rm --no-deps main bash /docker/bin/backup.sh solr
28+
docker-compose run --rm --no-deps main root bash /docker/bin/backup.sh solr
3329
docker-compose start solr
3430

3531
solr-restore:
3632
docker-compose stop solr
37-
docker-compose run --rm --no-deps main bash /docker/bin/restore.sh solr
33+
docker-compose run --rm --no-deps main root bash /docker/bin/restore.sh solr
3834
docker-compose start solr
3935

4036
#############################
@@ -53,9 +49,18 @@ clean:
5349
bash:
5450
docker-compose run --rm main bash
5551

52+
root:
53+
docker-compose run --rm main root
54+
5655
#############################
5756
# TYPO3
5857
#############################
5958

6059
scheduler:
61-
docker-compose run --rm main typo3/cli_dispatch.phpsh scheduler
60+
docker-compose run --rm main typo3/cli_dispatch.phpsh scheduler $(ARGS)
61+
62+
#############################
63+
# Argument fix workaround
64+
#############################
65+
%:
66+
@:

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Supports:
99
- Nginx or Apache HTTPd
1010
- PHP-FPM (with Xdebug and Xhprof)
1111
- MySQL, MariaDB or PerconaDB
12-
- Solr
12+
- Solr (disabled, without EXT:solr configuration)
1313
- Elasticsearch (disabled, without configuration)
1414
- Redis (disabled)
1515
- Memcached (disabled)
@@ -71,22 +71,23 @@ Logs (eg. for debugging)
7171
# or only php
7272
$ docker-compose logs main
7373

74-
# or only php and nginx
75-
$ docker-compose logs main nginx
74+
# or only php and webserver
75+
$ docker-compose logs main web
7676

7777

78-
## Create new project
78+
## Create project
7979

8080
First create and run the Docker containers using [docker-compose](https://github.com/docker/compose):
8181

8282
$ docker-compose up -d
8383

8484
Now create the project:
8585

86-
- [Create new TYPO3 project](README-TYPO3.md)
87-
- [Create new NEOS project](README-NEOS.md)
88-
- [Create new Symfony project](README-SYMFONY.md)
89-
- [Running any other php based project](README-OTHER.md)
86+
- [Create new TYPO3 project](doc/README-TYPO3.md)
87+
- [Create new NEOS project](doc/README-NEOS.md)
88+
- [Create new Symfony project](doc/README-SYMFONY.md)
89+
- [Running any other php based project](doc/README-OTHER.md)
90+
- [Running existing project](doc/README-EXISTING.md)
9091

9192
For an existing project just put your files into `code/` folder or use git to clone your project into `code/`.
9293

@@ -99,22 +100,24 @@ Container | Description
99100
------------------------- | -------------------------------
100101
main | Main container with PHP-FPM and tools (your entrypoint for bash, php and other stuff)
101102
storage | Storage container, eg. for Solr data
102-
nginx | Nginx webserver
103-
httpd (optional) | Apache HTTPD webserver
103+
web | Apache HTTPD or Nginx webserver
104104
mysql | MySQL database
105105
solr | Apache Solr server
106106
elasticsearch (optional) | Elasticsearch server
107107
memcached (optional) | Memcached server
108108
redis (optional) | Redis server
109109

110-
This directory will be mounted under `/docker` in `main`, `nginx` and `httpd` container.
110+
This directory will be mounted under `/docker` in `main` and `web` container.
111111

112112
### Makefile
113113

114114
Customize the [Makefile](Makefile) for your needs.
115115

116116
Command | Description
117117
------------------------- | -------------------------------
118+
make bash | Enter main container with bash (user www-data)
119+
make root | Enter main container with bash (user root)
120+
<br> |
118121
make backup | General backup (run all backup tasks)
119122
make restore | General restore (run all restore tasks)
120123
<br> |
@@ -187,6 +190,7 @@ TYPO3_CONTEXT | Context for TYPO3, can be used for TypoScript conditions
187190
FLOW_CONTEXT | Context for FLOW and NEOS
188191
<br> |
189192
MAIL_GATEWAY | Upstream server for sending mails (ssmtp)
193+
DNS_DOMAIN | List of wildcard domains pointing to webserver (eg. for local content fetching)
190194
<br> |
191195
MYSQL_ROOT_PASSWORD | Password for MySQL user "root"
192196
MYSQL_USER | Initial created MySQL user

bin/.config.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ if [ "$unamestr" == 'FreeBSD' -o "$unamestr" == 'Darwin' ]; then
1717
fi
1818

1919
if [ -z "`which $READLINK`" ]; then
20-
echo '$READLINK not installed'
20+
echo "[ERROR] $READLINK not installed"
21+
echo " make sure coreutils are installed"
22+
echo " MacOS: brew install coreutils"
23+
exit 1
2124
fi
2225

2326
SCRIPT_DIR=$(dirname $($READLINK -f "$0"))
@@ -33,7 +36,11 @@ BACKUP_MYSQL_FILE='mysql.sql.bz2'
3336
#######################################
3437

3538
errorMsg() {
36-
echo "[ERR] $*"
39+
echo "[ERROR] $*"
40+
}
41+
42+
logMsg() {
43+
echo " * $*"
3744
}
3845

3946
sectionHeader() {

bin/backup.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,25 @@ case "$1" in
1919
## MySQL
2020
###################################
2121
"mysql")
22-
rm -f -- "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
23-
mysqldump --opt --all-databases | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
22+
if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then
23+
logMsg "Removing old backup file..."
24+
rm -f -- "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
25+
fi
26+
27+
logMsg "Starting MySQL backup..."
28+
mysqldump --opt --single-transaction --all-databases | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
2429
;;
2530

2631
###################################
2732
## Solr
2833
###################################
2934
"solr")
30-
rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}"
31-
tar jcf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /data/solr/
35+
if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then
36+
logMsg "Removing old backup file..."
37+
rm -f -- "${BACKUP_DIR}/${BACKUP_SOLR_FILE}"
38+
fi
39+
40+
logMsg "Starting Solr backup..."
41+
tar jcPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" /data/solr/
3242
;;
33-
esac
43+
esac

bin/create-project.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
77

88
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.config.sh"
99

10-
if [ "$#" -ne 1 ]; then
11-
echo "No project type defined (either cms or neos)"
10+
if [ "$#" -lt 1 ]; then
11+
echo "No project type defined (either cms, neos, symfony or git)"
1212
exit 1
1313
fi
1414

@@ -21,7 +21,7 @@ case "$1" in
2121
###################################
2222
## TYPO3 CMS
2323
###################################
24-
"cms")
24+
"typo3")
2525
execInDir "$CODE_DIR" "composer create-project typo3/cms-base-distribution \"$CODE_DIR\""
2626
execInDir "$CODE_DIR" "touch FIRST_INSTALL"
2727
;;
@@ -41,6 +41,17 @@ case "$1" in
4141
execInDir "$CODE_DIR" "php /tmp/symfony.$$.phar new '$CODE_DIR'"
4242
rm -f -- /tmp/symfony.$$.phar
4343
;;
44+
45+
###################################
46+
## GIT
47+
###################################
48+
"git")
49+
if [ "$#" -lt 2 ]; then
50+
echo "Missing git url"
51+
exit 1
52+
fi
53+
git clone --recursive "$2" "$CODE_DIR"
54+
;;
4455
esac
4556

4657
touch -- "$CODE_DIR/.gitkeep"

bin/restore.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,27 @@ case "$1" in
1919
## MySQL
2020
###################################
2121
"mysql")
22-
bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | mysql
22+
if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then
23+
logMsg "Starting MySQL restore..."
24+
bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | mysql
25+
else
26+
errorMsg "MySQL backup file not found"
27+
exit 1
28+
fi
2329
;;
2430

2531
###################################
2632
## Solr
2733
###################################
2834
"solr")
29-
rm -rf /data/solr/* && mkdir -p /data/solr/
30-
tar jxf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" -C /
35+
if [ -f "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" ]; then
36+
logMsg "Starting Solr restore..."
37+
rm -rf /data/solr/* && mkdir -p /data/solr/
38+
chmod 777 /data/solr/
39+
tar jxPf "${BACKUP_DIR}/${BACKUP_SOLR_FILE}" -C /
40+
else
41+
errorMsg "Solr backup file not found"
42+
exit 1
43+
fi
3144
;;
32-
esac
45+
esac

doc/README-EXISTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[<-- Back to main section](../README.md)
2+
3+
# Running any existing project
4+
5+
## Create project
6+
7+
Checkout your git repository
8+
9+
$ make create-project git https://github..../
10+
11+
or manually
12+
13+
$ git clone --recursive https://github..../ code/
14+
15+
Check `DOCUMENT_ROOT` and `DOCUMENT_INDEX` in `docker-env.yml`
16+
17+
## Cli runner
18+
19+
You can run one-shot command inside the `main` service container:
20+
21+
$ docker-compose run --rm main any-php-file.php argument1 argument2
22+
23+
$ docker-compose run --rm main bash
24+
25+
Webserver is available at Port 8000

README-NEOS.md renamed to doc/README-NEOS.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[<-- Back to main section](README.md)
1+
[<-- Back to main section](../README.md)
22

33
# Running NEOS
44

55
## Create NEOS project
66

77
For the first NEOS setup (make sure [composer](https://getcomposer.org/) is installed):
88

9-
$ make create-neos-project
9+
$ make create-project neos
1010

1111
or
1212

@@ -26,8 +26,12 @@ most of the time there is no need to enter any Docker container.
2626

2727
You can run one-shot command inside the `main` service container:
2828

29-
$ docker-compose run --rm code flow core:setfilepermissions
29+
# commands with root rights
30+
$ docker-compose run --rm main root ./flow core:setfilepermissions
3031

31-
$ docker-compose run --rm code bash
32+
# normal commands
33+
$ docker-compose run --rm main ./flow core:anyothercommand
3234

33-
Webserver is available at Port 8000
35+
$ docker-compose run --rm main bash
36+
37+
Webserver is available at Port 8000

README-OTHER.md renamed to doc/README-OTHER.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[<-- Back to main section](README.md)
1+
[<-- Back to main section](../README.md)
22

33
# Running any php based project
44

@@ -12,8 +12,8 @@
1212

1313
You can run one-shot command inside the `main` service container:
1414

15-
$ docker-compose run --rm code any-php-file.php argument1 argument2
15+
$ docker-compose run --rm main any-php-file.php argument1 argument2
1616

17-
$ docker-compose run --rm code bash
17+
$ docker-compose run --rm main bash
1818

19-
Webserver is available at Port 8000
19+
Webserver is available at Port 8000

0 commit comments

Comments
 (0)