大概就是这样子弄:
api_dockerfile:
```
FROM my_php
COPY ./ /app
WORKDIR /app
COPY ./docker/php-fpm/
docker-entrypoint.sh /usr/local/bin/
docker-entrypoint.shRUN rm -rf /app/docker \
&& chmod +x /usr/local/bin/
docker-entrypoint.shENTRYPOINT ["
docker-entrypoint.sh"]
CMD ["php-fpm"]
```
docker-entrypoint.sh:
```
#!/bin/sh
composer install
php artisan storage:link
php artisan migrate
php artisan make:lang-json
chown -R www-data:www-data lang/ storage/
service supervisor start
supervisorctl reread
supervisorctl update
supervisorctl start laravel-worker:*
exec docker-php-entrypoint "$@"
```
laravel-worker.conf:
```
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /app/artisan queue:work --sleep=2 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/root/laravel-worker.log
stopwaitsecs=3600
```