Skip to content

Commit 055b182

Browse files
committed
[DEV] Split docker-compose file for different hosts
1 parent 31abed8 commit 055b182

File tree

4 files changed

+74
-3
lines changed

4 files changed

+74
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ var
1818
/config/
1919
dynamicReturnTypeMeta.json
2020
/Documentation-GENERATED-temp/
21+
docker-compose.yml

docker-compose.yml renamed to .project/docker/docker-compose.darwin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818

1919
php:
2020
build:
21-
context: ./.project/docker/php/
21+
context: .project/docker/php/
2222
dockerfile: Dockerfile
2323
volumes:
2424
- ./:/app/:cached
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: "3.7"
2+
3+
services:
4+
httpd:
5+
image: in2code/httpd:2.4-alpine
6+
environment:
7+
WEB_DOCUMENT_ROOT: /app/${WEBROOT}/
8+
VIRTUAL_HOST: ${HOST}
9+
VIRTUAL_PORT: 443
10+
VIRTUAL_PROTO: https
11+
volumes:
12+
- ./:/app/:cached
13+
networks:
14+
default:
15+
aliases:
16+
- ${HOST}
17+
18+
php:
19+
image: in2code/php-dev:7.2-fpm
20+
volumes:
21+
- ./:/app/:cached
22+
- $HOME/.composer/auth.json:/tmp/composer/auth.json
23+
- $HOME/.composer/cache/:/tmp/composer/cache/
24+
env_file:
25+
- .env
26+
27+
mysql:
28+
image: in2code/mysql:5.7
29+
env_file:
30+
- .env
31+
volumes:
32+
- mysql:/var/lib/mysql/
33+
- ${SQLDUMPSDIR}:/${SQLDUMPSDIR}
34+
ports:
35+
- ${SQLPORT}:3306
36+
37+
node:
38+
image: node:10
39+
user: node
40+
command: "npm run run-all"
41+
volumes:
42+
- ./:/home/node/app/
43+
working_dir: /home/node/app/Resources/Private
44+
45+
chrome:
46+
image: selenium/standalone-chrome-debug:3.141
47+
volumes:
48+
- /dev/shm:/dev/shm
49+
ports:
50+
- ${CHROMEPORT}:5900
51+
52+
mail:
53+
image: mailhog/mailhog
54+
environment:
55+
VIRTUAL_PORT: 8025
56+
VIRTUAL_HOST: ${MAIL}
57+
58+
volumes:
59+
typo3var:
60+
mysql:

Makefile

+12-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ stop:
3131
## Removes all containers and volumes
3232
destroy: stop
3333
echo "$(EMOJI_litter) Removing the project"
34-
git clean -dfx
3534
docker-compose down -v --remove-orphans
35+
git clean -dfx
3636

3737
## Starts docker-compose up -d
3838
start:
@@ -82,6 +82,15 @@ create-certificate: install-mkcert
8282
if [[ ! -f $(HOME)/.dinghy/certs/${HOST}.key ]]; then mkcert -cert-file $(HOME)/.dinghy/certs/${HOST}.crt -key-file $(HOME)/.dinghy/certs/${HOST}.key ${HOST}; fi;
8383
if [[ ! -f $(HOME)/.dinghy/certs/${MAIL}.key ]]; then mkcert -cert-file $(HOME)/.dinghy/certs/${MAIL}.crt -key-file $(HOME)/.dinghy/certs/${MAIL}.key ${MAIL}; fi;
8484

85+
## Choose the right docker-compose file for your environment
86+
link-compose-file:
87+
echo "$(EMOJI_triangular_ruler) Linking the OS specific compose file"
88+
ifeq ($(shell uname -s), Darwin)
89+
ln -snf .project/docker/docker-compose.darwin.yml docker-compose.yml
90+
else
91+
ln -snf .project/docker/docker-compose.unix.yml docker-compose.yml
92+
endif
93+
8594
## Initialize the docker setup
8695
init-docker: create-dirs create-certificate
8796
echo "$(EMOJI_rocket) Initializing docker environment"
@@ -116,7 +125,7 @@ typo3-install-autocomplete:
116125
curl -sLO https://raw.githubusercontent.com/TYPO3/TYPO3.CMS/master/dynamicReturnTypeMeta.json
117126

118127
## To start an existing project incl. rsync from fileadmin, uploads and database dump
119-
install-project: destroy add-hosts-entry init-docker composer-install typo3-add-dockerconfig typo3-install-autocomplete typo3-setupinstall mysql-restore typo3-clearcache typo3-comparedb
128+
install-project: destroy link-compose-file add-hosts-entry init-docker composer-install typo3-add-dockerconfig typo3-install-autocomplete typo3-setupinstall mysql-restore typo3-clearcache typo3-comparedb
120129
echo "---------------------"
121130
echo ""
122131
echo "The project is online $(EMOJI_thumbsup)"
@@ -208,3 +217,4 @@ EMOJI_helicopter := "🚁️"
208217
EMOJI_broom := "🧹"
209218
EMOJI_nutandbolt := "🔩"
210219
EMOJI_crystal_ball := "🔮"
220+
EMOJI_triangular_ruler := "📐"

0 commit comments

Comments
 (0)