File tree Expand file tree Collapse file tree 9 files changed +73
-6
lines changed Expand file tree Collapse file tree 9 files changed +73
-6
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ env-prod:
34
34
ssh :
35
35
@docker-compose $(project ) exec laravel bash
36
36
37
+ ssh-supervisord :
38
+ @docker-compose $(project ) exec supervisord bash
39
+
37
40
exec :
38
41
@docker-compose $(project ) exec laravel $$ cmd
39
42
Original file line number Diff line number Diff line change @@ -16,6 +16,21 @@ services:
16
16
- " 443:443"
17
17
depends_on :
18
18
- mysql
19
+ links :
20
+ - mysql
21
+
22
+ supervisord :
23
+ image : laravel:latest
24
+ build :
25
+ context : .
26
+ dockerfile : ./docker/development/Dockerfile
27
+ container_name : supervisord
28
+ user : root
29
+ depends_on :
30
+ - mysql
31
+ links :
32
+ - mysql
33
+ command : ["/usr/bin/supervisord"]
19
34
20
35
mysql :
21
36
image : mysql:8.0
@@ -24,8 +39,6 @@ services:
24
39
environment :
25
40
- MYSQL_ROOT_PASSWORD=secret
26
41
- MYSQL_DATABASE=laravel
27
- expose :
28
- - " 33061"
29
42
ports :
30
43
- " 33061:3306"
31
44
volumes :
Original file line number Diff line number Diff line change @@ -16,6 +16,21 @@ services:
16
16
- " 443:443"
17
17
depends_on :
18
18
- mysql
19
+ links :
20
+ - mysql
21
+
22
+ supervisord :
23
+ image : laravel:latest
24
+ build :
25
+ context : .
26
+ dockerfile : ./docker/development/Dockerfile
27
+ container_name : supervisord
28
+ user : root
29
+ depends_on :
30
+ - mysql
31
+ links :
32
+ - mysql
33
+ command : ["/usr/bin/supervisord"]
19
34
20
35
mysql :
21
36
image : mysql:8.0
@@ -24,8 +39,6 @@ services:
24
39
environment :
25
40
- MYSQL_ROOT_PASSWORD=secret
26
41
- MYSQL_DATABASE=laravel
27
- expose :
28
- - " 33061"
29
42
ports :
30
43
- " 33061:3306"
31
44
volumes :
Original file line number Diff line number Diff line change @@ -18,6 +18,21 @@ services:
18
18
- .:/var/www/laravel
19
19
depends_on :
20
20
- mysql
21
+ links :
22
+ - mysql
23
+
24
+ supervisord :
25
+ image : laravel:latest
26
+ build :
27
+ context : .
28
+ dockerfile : ./docker/development/Dockerfile
29
+ container_name : supervisord
30
+ user : root
31
+ depends_on :
32
+ - mysql
33
+ links :
34
+ - mysql
35
+ command : ["/usr/bin/supervisord"]
21
36
22
37
mysql :
23
38
image : mysql:8.0
@@ -26,8 +41,6 @@ services:
26
41
environment :
27
42
- MYSQL_ROOT_PASSWORD=secret
28
43
- MYSQL_DATABASE=laravel
29
- expose :
30
- - " 33061"
31
44
ports :
32
45
- " 33061:3306"
33
46
volumes :
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
10
10
libxml2 \
11
11
libxml2-dev \
12
12
libreadline-dev \
13
+ supervisor \
14
+ cron \
13
15
&& rm -r /var/lib/apt/lists/* \
14
16
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
15
17
&& docker-php-ext-install \
@@ -40,6 +42,12 @@ COPY ./docker/hosts/laravel-ssl.conf /etc/apache2/sites-available/laravel-ssl.co
40
42
RUN a2dissite 000-default.conf && a2ensite laravel.conf && a2ensite laravel-ssl
41
43
COPY ./docker/development/php.ini /usr/local/etc/php/php.ini
42
44
45
+ # add supervisor
46
+ RUN mkdir -p /var/log/supervisor
47
+ COPY --chown=root:root ./docker/other/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
48
+ COPY --chown=root:root ./docker/other/cron /var/spool/cron/crontabs/root
49
+ RUN chmod 0600 /var/spool/cron/crontabs/root
50
+
43
51
# generate certificates
44
52
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=AT/ST=Vienna/L=Vienna/O=Security/OU=Development/CN=example.com"
45
53
Original file line number Diff line number Diff line change
1
+ * * * * * cd /var/www/laravel && /usr/local/bin/php artisan schedule:run > /proc/1/fd/1 2>/proc/1/fd/2
Original file line number Diff line number Diff line change
1
+ [supervisord]
2
+ nodaemon=true
3
+
4
+ [program:cron]
5
+ command=/usr/sbin/cron -l 2 -f
6
+ autostart=true
7
+ autorestart=true
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
10
10
libxml2 \
11
11
libxml2-dev \
12
12
libreadline-dev \
13
+ supervisor \
14
+ cron \
13
15
&& rm -r /var/lib/apt/lists/* \
14
16
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
15
17
&& docker-php-ext-install \
@@ -36,6 +38,12 @@ COPY ./docker/hosts/laravel-ssl.conf /etc/apache2/sites-available/laravel-ssl.co
36
38
RUN a2dissite 000-default.conf && a2ensite laravel.conf && a2ensite laravel-ssl
37
39
COPY ./docker/production/php.ini /usr/local/etc/php/php.ini
38
40
41
+ # add supervisor
42
+ RUN mkdir -p /var/log/supervisor
43
+ COPY --chown=root:root ./docker/other/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
44
+ COPY --chown=root:root ./docker/other/cron /var/spool/cron/crontabs/root
45
+ RUN chmod 0600 /var/spool/cron/crontabs/root
46
+
39
47
# generate certificates. TODO: change it
40
48
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=AT/ST=Vienna/L=Vienna/O=Security/OU=Development/CN=example.com"
41
49
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ Note: OS recommendation - Linux Ubuntu based.
62
62
make stop
63
63
make restart
64
64
make ssh
65
+ make ssh-supervisord
65
66
make composer-install
66
67
make composer-update
67
68
make info
You can’t perform that action at this time.
0 commit comments