Skip to content

Commit bac0360

Browse files
committed
[FEATURE] Provide local dev environment
Two local dev environments based on docker are provided: - a plain local docker installation - a ddev based installation Resolves: #691 Signed-off-by: Marcus Schwemer <marcus.schwemer@in2code.de>
1 parent a290040 commit bac0360

25 files changed

+1060
-75
lines changed

.ddev/commands/host/initialize

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
## Description: import given test data into ddev (database and configurations)
4+
## Usage: initialize
5+
## Example: "ddev import-data"
6+
7+
if ! command -v "git-lfs" &> /dev/null
8+
then
9+
echo "COMMAND "git lfs" could not be found"
10+
echo "Please install git-lfs support, see: https://git-lfs.github.com/"
11+
exit
12+
fi
13+
14+
git lfs pull
15+
ddev import-db --src=.project/data/db.sql.gz
16+
mkdir -p config/sites/main && cp .project/TYPO3/config.yaml config/sites/main/
17+
cp .ddev/typo3/AdditionalConfiguration.php .Build/Web/typo3conf/
18+
ddev typo3cms install:setup

.ddev/commands/web/typo3

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This assumes that the typo3 command will be in the $PATH; if in vendor/bin/ it will be
4+
5+
## Description: Run TYPO3 CLI (typo3) command inside the web container
6+
## Usage: typo3 [args]
7+
## Example: "ddev typo3 site:list" or "ddev typo3 list" or "ddev typo3 extension:list"
8+
## ProjectTypes: typo3
9+
10+
.Build/bin/typo3 "$@"

.ddev/commands/web/typo3cms

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This assumes that the typo3cms command will be in the $PATH; if in vendor/bin/ it will be
4+
5+
## Description: Run TYPO3 Console (typo3cms) command inside the web container
6+
## Usage: typo3cms [args]
7+
## Example: "ddev typo3cms cache:flush" or "ddev typo3cms database:export"
8+
## ProjectTypes: typo3
9+
10+
.Build/bin/typo3cms "$@"

.ddev/config.yaml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: powermail
2+
type: typo3
3+
docroot: .Build/Web/
4+
php_version: "7.2"
5+
webserver_type: nginx-fpm
6+
router_http_port: "80"
7+
router_https_port: "443"
8+
xdebug_enabled: false
9+
additional_hostnames: []
10+
additional_fqdns: []
11+
mariadb_version: "10.3"
12+
mysql_version: ""
13+
use_dns_when_possible: true
14+
composer_version: "2"
15+
web_environment: []
16+
hooks:
17+
post-start:
18+
- exec: composer install
19+
- exec: cp .ddev/typo3/AdditionalConfiguration.php .Build/Web/typo3conf/
20+
21+
22+
# This config.yaml was created with ddev version v1.17.5
23+
# webimage: drud/ddev-webserver:v1.17.4
24+
# dbimage: drud/ddev-dbserver-mariadb-10.3:v1.17.3
25+
# dbaimage: phpmyadmin:5
26+
# However we do not recommend explicitly wiring these images into the
27+
# config.yaml as they may break future versions of ddev.
28+
# You can update this config.yaml using 'ddev config'.
29+
30+
# Key features of ddev's config.yaml:
31+
32+
# name: <projectname> # Name of the project, automatically provides
33+
# http://projectname.ddev.site and https://projectname.ddev.site
34+
35+
# type: <projecttype> # drupal6/7/8, backdrop, typo3, wordpress, php
36+
37+
# docroot: <relative_path> # Relative path to the directory containing index.php.
38+
39+
# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4" "8.0"
40+
41+
# You can explicitly specify the webimage, dbimage, dbaimage lines but this
42+
# is not recommended, as the images are often closely tied to ddev's' behavior,
43+
# so this can break upgrades.
44+
45+
# webimage: <docker_image> # nginx/php docker image.
46+
# dbimage: <docker_image> # mariadb docker image.
47+
# dbaimage: <docker_image>
48+
49+
# mariadb_version and mysql_version
50+
# ddev can use many versions of mariadb and mysql
51+
# However these directives are mutually exclusive
52+
# mariadb_version: 10.2
53+
# mysql_version: 8.0
54+
55+
# router_http_port: <port> # Port to be used for http (defaults to port 80)
56+
# router_https_port: <port> # Port for https (defaults to 443)
57+
58+
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
59+
# Note that for most people the commands
60+
# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better,
61+
# as leaving xdebug enabled all the time is a big performance hit.
62+
63+
# webserver_type: nginx-fpm # or apache-fpm
64+
65+
# timezone: Europe/Berlin
66+
# This is the timezone used in the containers and by PHP;
67+
# it can be set to any valid timezone,
68+
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
69+
# For example Europe/Dublin or MST7MDT
70+
71+
# composer_version: ""
72+
# if composer_version:"" it will use the current ddev default composer release.
73+
# It can also be set to "1", to get most recent composer v1
74+
# or "2" for most recent composer v2.
75+
# It can be set to any existing specific composer version.
76+
# After first project 'ddev start' this will not be updated until it changes
77+
78+
# additional_hostnames:
79+
# - somename
80+
# - someothername
81+
# would provide http and https URLs for "somename.ddev.site"
82+
# and "someothername.ddev.site".
83+
84+
# additional_fqdns:
85+
# - example.com
86+
# - sub1.example.com
87+
# would provide http and https URLs for "example.com" and "sub1.example.com"
88+
# Please take care with this because it can cause great confusion.
89+
90+
# upload_dir: custom/upload/dir
91+
# would set the destination path for ddev import-files to custom/upload/dir.
92+
93+
# working_dir:
94+
# web: /var/www/html
95+
# db: /home
96+
# would set the default working directory for the web and db services.
97+
# These values specify the destination directory for ddev ssh and the
98+
# directory in which commands passed into ddev exec are run.
99+
100+
# omit_containers: [db, dba, ddev-ssh-agent]
101+
# Currently only these containers are supported. Some containers can also be
102+
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
103+
# the "db" container, several standard features of ddev that access the
104+
# database container will be unusable.
105+
106+
# nfs_mount_enabled: false
107+
# Great performance improvement but requires host configuration first.
108+
# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container
109+
110+
# fail_on_hook_fail: False
111+
# Decide whether 'ddev start' should be interrupted by a failing hook
112+
113+
# host_https_port: "59002"
114+
# The host port binding for https can be explicitly specified. It is
115+
# dynamic unless otherwise specified.
116+
# This is not used by most people, most people use the *router* instead
117+
# of the localhost port.
118+
119+
# host_webserver_port: "59001"
120+
# The host port binding for the ddev-webserver can be explicitly specified. It is
121+
# dynamic unless otherwise specified.
122+
# This is not used by most people, most people use the *router* instead
123+
# of the localhost port.
124+
125+
# host_db_port: "59002"
126+
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
127+
# unless explicitly specified.
128+
129+
# phpmyadmin_port: "8036"
130+
# phpmyadmin_https_port: "8037"
131+
# The PHPMyAdmin ports can be changed from the default 8036 and 8037
132+
133+
# mailhog_port: "8025"
134+
# mailhog_https_port: "8026"
135+
# The MailHog ports can be changed from the default 8025 and 8026
136+
137+
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
138+
# Extra Debian packages that are needed in the webimage can be added here
139+
140+
# dbimage_extra_packages: [telnet,netcat]
141+
# Extra Debian packages that are needed in the dbimage can be added here
142+
143+
# use_dns_when_possible: true
144+
# If the host has internet access and the domain configured can
145+
# successfully be looked up, DNS will be used for hostname resolution
146+
# instead of editing /etc/hosts
147+
# Defaults to true
148+
149+
# project_tld: ddev.site
150+
# The top-level domain used for project URLs
151+
# The default "ddev.site" allows DNS lookup via a wildcard
152+
# If you prefer you can change this to "ddev.local" to preserve
153+
# pre-v1.9 behavior.
154+
155+
# ngrok_args: --subdomain mysite --auth username:pass
156+
# Provide extra flags to the "ngrok http" command, see
157+
# https://ngrok.com/docs#http or run "ngrok http -h"
158+
159+
# disable_settings_management: false
160+
# If true, ddev will not create CMS-specific settings files like
161+
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
162+
# In this case the user must provide all such settings.
163+
164+
# You can inject environment variables into the web container with:
165+
# web_environment:
166+
# - SOMEENV=somevalue
167+
# - SOMEOTHERENV=someothervalue
168+
169+
# no_project_mount: false
170+
# (Experimental) If true, ddev will not mount the project into the web container;
171+
# the user is responsible for mounting it manually or via a script.
172+
# This is to enable experimentation with alternate file mounting strategies.
173+
# For advanced users only!
174+
175+
# Many ddev commands can be extended to run tasks before or after the
176+
# ddev command is executed, for example "post-start", "post-import-db",
177+
# "pre-composer", "post-composer"
178+
# See https://ddev.readthedocs.io/en/stable/users/extending-commands/ for more
179+
# information on the commands that can be extended and the tasks you can define
180+
# for them. Example:
181+
#hooks:
182+
# post-start:
183+
# - exec: composer install -d /var/www/html

.ddev/docker-compose.browser.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.6'
2+
services:
3+
chromedriver:
4+
container_name: ddev-${DDEV_SITENAME}-chromedriver
5+
image: selenium/standalone-chrome-debug
6+
restart: "no"
7+
volumes:
8+
- /dev/shm:/dev/shm
9+
ports:
10+
- 4444
11+
- "5900:5900"
12+
external_links:
13+
- "ddev-router:${DDEV_SITENAME}.ddev.site"

.ddev/docker-compose.typo3.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3.6'
2+
services:
3+
web:
4+
environment:
5+
- TYPO3_CONTEXT=Development/DDEV
6+
# Variables for first installation
7+
- TYPO3_INSTALL_DB_DRIVER=mysql
8+
- TYPO3_INSTALL_DB_USER=db
9+
- TYPO3_INSTALL_DB_PASSWORD=db
10+
- TYPO3_INSTALL_DB_HOST=db
11+
- TYPO3_INSTALL_DB_PORT=3306
12+
- TYPO3_INSTALL_DB_USE_EXISTING=1
13+
- TYPO3_INSTALL_DB_DBNAME=db
14+
- TYPO3_INSTALL_SITE_SETUP_TYPE=no
15+
- TYPO3_INSTALL_WEB_SERVER_CONFIG=none
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/**
4+
* #ddev-generated: Automatically generated TYPO3 AdditionalConfiguration.php file.
5+
* ddev manages this file and may delete or overwrite the file unless this comment is removed.
6+
* It is recommended that you leave this file alone.
7+
*/
8+
9+
if (getenv('IS_DDEV_PROJECT') == 'true') {
10+
$GLOBALS['TYPO3_CONF_VARS'] = array_replace_recursive(
11+
$GLOBALS['TYPO3_CONF_VARS'],
12+
[
13+
'DB' => [
14+
'Connections' => [
15+
'Default' => [
16+
'dbname' => 'db',
17+
'host' => 'db',
18+
'password' => 'db',
19+
'port' => '3306',
20+
'user' => 'db',
21+
],
22+
],
23+
],
24+
// This GFX configuration allows processing by installed ImageMagick 6
25+
'GFX' => [
26+
'processor' => 'ImageMagick',
27+
'processor_path' => '/usr/bin/',
28+
'processor_path_lzw' => '/usr/bin/',
29+
],
30+
// This mail configuration sends all emails to mailhog
31+
'MAIL' => [
32+
'transport' => 'smtp',
33+
'transport_smtp_server' => 'localhost:1025',
34+
],
35+
'SYS' => [
36+
'trustedHostsPattern' => '.*.*',
37+
'devIPmask' => '*',
38+
'displayErrors' => 1,
39+
],
40+
]
41+
);
42+
}

.ddev/typo3/config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
base: 'https://femanager.ddev.site/'
2+
baseVariants: { }
3+
errorHandling: { }
4+
languages:
5+
-
6+
title: English
7+
enabled: true
8+
base: /
9+
typo3Language: default
10+
locale: en_US.UTF-8
11+
iso-639-1: en
12+
websiteTitle: ''
13+
navigationTitle: ''
14+
hreflang: en-US
15+
direction: ltr
16+
flag: en-us-gb
17+
languageId: '0'
18+
rootPageId: 1
19+
routes: { }
20+
websiteTitle: ''

.env

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
HOST=local.powermail.de
2+
MAIL=mail.powermail.de
3+
4+
WEBROOT=.Build/Web
5+
TYPO3_CACHE_DIR=var
6+
7+
SQLDUMPSDIR=.project/data/
8+
SQLDUMPFILE=db.sql.gz
9+
SQLPORT=42473
10+
11+
CHROMEPORT=19647
12+
13+
# Service names from docker-compose.yml to include in URL generation make target. Delimited by \|
14+
SERVICELIST=mail
15+
16+
# MySQL variables
17+
MYSQL_ROOT_PASSWORD=root
18+
MYSQL_DATABASE=typo3
19+
MYSQL_PASSWORD=app
20+
MYSQL_USER=app
21+
MYSQL_HOST=mysql
22+
23+
# TYPO3
24+
TYPO3_CONTEXT=Development/Docker
25+
26+
# TYPO3 Console Setup
27+
28+
TYPO3_INSTALL_DB_DRIVER=mysqli
29+
TYPO3_INSTALL_DB_USER=app
30+
TYPO3_INSTALL_DB_PASSWORD=app
31+
TYPO3_INSTALL_DB_HOST=mysql
32+
TYPO3_INSTALL_DB_PORT=3306
33+
TYPO3_INSTALL_DB_UNIX_SOCKET=""
34+
TYPO3_INSTALL_DB_USE_EXISTING=y
35+
TYPO3_INSTALL_DB_DBNAME=typo3
36+
TYPO3_INSTALL_ADMIN_USER=admin
37+
TYPO3_INSTALL_ADMIN_PASSWORD=password
38+
TYPO3_INSTALL_SITE_NAME="Powermail"
39+
TYPO3_INSTALL_SITE_SETUP_TYPE=no
40+
TYPO3_INSTALL_WEB_SERVER_CONFIG=apache

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
msi.iws
22
.idea/
33
nbproject/
4+
Resources/Private/node_modules/
45
.DS_Store
56
.DS_Store?
67
._*
@@ -10,12 +11,12 @@ ehthumbs.db
1011
Thumbs.db
1112
.svn
1213
.sass-cache
13-
node_modules/
14-
.sass-cache/
15-
npm-debug.log
16-
Resources/Private/node_modules/
17-
dynamicReturnTypeMeta.json
18-
.Build/
14+
.Build
1915
composer.lock
16+
package-lock.json
17+
var
18+
dynamicReturnTypeMeta.json
19+
/Documentation-GENERATED-temp/
20+
docker-compose.yml
2021
.php_cs.cache
21-
var/
22+
config/

0 commit comments

Comments
 (0)