mirror of
				https://github.com/cp6/my-idlers.git
				synced 2025-11-03 23:59:09 +00:00 
			
		
		
		
	Add Dockerfile, fix https
This commit is contained in:
		
							parent
							
								
									5b1c1b663f
								
							
						
					
					
						commit
						4e661682c2
					
				
					 3 changed files with 38 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					FROM php:8.1-fpm-alpine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN docker-php-ext-install pdo pdo_mysql sockets
 | 
				
			||||||
 | 
					RUN curl -sS https://getcomposer.org/installer | php -- \
 | 
				
			||||||
 | 
					     --install-dir=/usr/local/bin --filename=composer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					COPY . .
 | 
				
			||||||
 | 
					RUN composer install && \
 | 
				
			||||||
 | 
					    cp .env.example .env
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENTRYPOINT ["/app/run.sh"]
 | 
				
			||||||
| 
						 | 
					@ -35,6 +35,9 @@ class RouteServiceProvider extends ServiceProvider
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public function boot()
 | 
					    public function boot()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
						if (config('app.env') === 'production') {
 | 
				
			||||||
 | 
								\Illuminate\Support\Facades\URL::forceScheme('https');
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
        $this->configureRateLimiting();
 | 
					        $this->configureRateLimiting();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->routes(function () {
 | 
					        $this->routes(function () {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										21
									
								
								run.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								run.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,21 @@
 | 
				
			||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# TODO: global env vars aren't used.
 | 
				
			||||||
 | 
					cat > /app/.env.production << EOF
 | 
				
			||||||
 | 
					APP_NAME=MyIdlers
 | 
				
			||||||
 | 
					APP_DEBUG=true
 | 
				
			||||||
 | 
					APP_KEY=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DB_CONNECTION=mysql
 | 
				
			||||||
 | 
					DB_HOST=${DB_HOST}
 | 
				
			||||||
 | 
					DB_DATABASE=${DB_DATABASE}
 | 
				
			||||||
 | 
					DB_USERNAME=${DB_USERNAME}
 | 
				
			||||||
 | 
					DB_PASSWORD=${DB_PASSWORD}
 | 
				
			||||||
 | 
					APP_URL=${APP_URL}
 | 
				
			||||||
 | 
					ASSET_URL=${ASSET_URL}
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# TODO: only run this once
 | 
				
			||||||
 | 
					php artisan key:generate
 | 
				
			||||||
 | 
					php artisan migrate:fresh --seed --force
 | 
				
			||||||
 | 
					php artisan serve --host=0.0.0.0 --port=8000 --env=production
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue