update docker
This commit is contained in:
		
							parent
							
								
									67c2504bfa
								
							
						
					
					
						commit
						b7b4bc763e
					
				|  | @ -1,6 +1,6 @@ | |||
| version : '3' | ||||
| 
 | ||||
| name: laravel-rabbitmq | ||||
| name: laravel-rabbitmq${VERSION} | ||||
| 
 | ||||
| networks: | ||||
|   laravel: | ||||
|  | @ -13,14 +13,14 @@ services: | |||
|       - ./src:/app | ||||
|     command: "sh /app/laravel-entrypoint.sh" | ||||
|     ports: | ||||
|       - 1000:8000 | ||||
|       - 1001:8001 | ||||
|       - 100${VERSION}:8000 | ||||
|     networks: | ||||
|       - laravel | ||||
|     depends_on: | ||||
|       - redis | ||||
| 
 | ||||
|   puppeteer: | ||||
|     container_name: puppeteer | ||||
|     build: | ||||
|       context: ./.docker/puppeteer | ||||
|       dockerfile: Dockerfile | ||||
|  | @ -29,6 +29,7 @@ services: | |||
|       - laravel | ||||
| 
 | ||||
|   socketio: | ||||
|     container_name: socketio | ||||
|     build: | ||||
|       context: ./.docker/socketio | ||||
|       dockerfile: Dockerfile | ||||
|  | @ -39,9 +40,8 @@ services: | |||
| 
 | ||||
|   redis: | ||||
|     image: redis | ||||
|     container_name: redis | ||||
|     ports: | ||||
|       - "6379:6379" | ||||
|       - ":6379" | ||||
|     networks: | ||||
|       - laravel | ||||
| 
 | ||||
|  |  | |||
|  | @ -0,0 +1,33 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Console\Commands; | ||||
| 
 | ||||
| use App\Jobs\ScreenshotJob; | ||||
| use Illuminate\Console\Command; | ||||
| 
 | ||||
| class JobRun extends Command | ||||
| { | ||||
|     /** | ||||
|      * The name and signature of the console command. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $signature = 'job:run'; | ||||
| 
 | ||||
|     /** | ||||
|      * The console command description. | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $description = ''; | ||||
| 
 | ||||
|     /** | ||||
|      * Execute the console command. | ||||
|      * | ||||
|      * @return int | ||||
|      */ | ||||
|     public function handle() | ||||
|     { | ||||
|         dispatch(new ScreenshotJob); | ||||
|     } | ||||
| } | ||||
|  | @ -9,7 +9,7 @@ use Illuminate\Queue\InteractsWithQueue; | |||
| use Illuminate\Queue\SerializesModels; | ||||
| use Illuminate\Support\Facades\Artisan; | ||||
| 
 | ||||
| class ProcessJob implements ShouldQueue | ||||
| class ScreenshotJob implements ShouldQueue | ||||
| { | ||||
|     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||||
| 
 | ||||
|  | @ -21,7 +21,7 @@ class ProcessJob implements ShouldQueue | |||
|      */ | ||||
|     public function __construct() | ||||
|     { | ||||
|         $process = 'process' . rand(1, 3); | ||||
|         $process = 'process' . random_int(1, 3); | ||||
|         $this->process = $process; | ||||
|         $this->onQueue($process); | ||||
|     } | ||||
|  | @ -33,6 +33,9 @@ class ProcessJob implements ShouldQueue | |||
|      */ | ||||
|     public function handle() | ||||
|     { | ||||
|         var_dump('hello world'); | ||||
|         file_put_contents( | ||||
|             public_path('pupeteer/' . time() . '.jpg'), | ||||
|             file_get_contents('http://puppeteer:4000?url=' . 'https://payment.nswteam.net/') | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|  | @ -21,13 +21,3 @@ Route::get('/', function () { | |||
| }); | ||||
| 
 | ||||
| Route::view('/queue', 'queue'); | ||||
| Route::get('/pupeteer', function (Request $request) { | ||||
|     file_put_contents( | ||||
|         public_path('pupeteer/' . time() . '.jpg'), | ||||
|         file_get_contents('http://puppeteer:4000?url=' . $request->input('url')) | ||||
|     ); | ||||
| 
 | ||||
|     return dump( | ||||
|         glob(public_path('pupeteer/*')) | ||||
|     ); | ||||
| }); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue