File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,37 @@ Make sure to adjust your `.env` accordingly and set `APP_URL` to `http://localho
69
69
70
70
Run `docker-compose up` to start the services.
71
71
72
+ # ## Startup Commands
73
+
74
+ Further commands can be defined via ENV variable `STARTUP_COMMANDXXX`, which are executed at container start before the actual command.
75
+
76
+ The commands must be numbered sequentially and start with 1 (e.g. `STARTUP_COMMAND1=command`, `STARTUP_COMMAND2=...`).
77
+
78
+ ` ` ` yml
79
+ version: '3.7'
80
+ services:
81
+ app:
82
+ image: sourceboat/docker-laravel
83
+ command: /home/app/run-prod.sh
84
+ restart: unless-stopped
85
+ environment:
86
+ - PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
87
+ - PHP_MEMORY_LIMIT=1G
88
+ - STARTUP_COMMAND1=php artisan migrate --force
89
+ - STARTUP_COMMAND2=php artisan horizon:restart
90
+ volumes:
91
+ - ./:/opt/app:cached
92
+ ports:
93
+ - "8080:8080"
94
+ depends_on:
95
+ - mysql
96
+ mysql:
97
+ image: mysql:8.0
98
+ environment:
99
+ - "MYSQL_ROOT_PASSWORD=secret"
100
+ - "MYSQL_DATABASE=default"
101
+ ` ` `
102
+
72
103
# ## Production
73
104
74
105
` WIP`
@@ -80,6 +111,7 @@ Check [releases](https://github.com/sourceboat/docker-laravel/releases) for all
80
111
# # Credits
81
112
82
113
- [Phil-Bastian Berndt](https://github.com/pehbehbeh)
114
+ - [Philipp Kübler](https://github.com/PKuebler)
83
115
- [All Contributors](https://github.com/sourceboat/docker-laravel/graphs/contributors)
84
116
85
117
# # License
You can’t perform that action at this time.
0 commit comments