- 
                Notifications
    
You must be signed in to change notification settings  - Fork 44
 
[Draft] Production Docker environment #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            nazmulpcc
  wants to merge
  5
  commits into
  theihasan:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
nazmulpcc:docker-environment
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            5 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      a2cdaeb
              
                setup octane
              
              
                nazmulpcc b83c71a
              
                Dockerfile & docker compose configuration
              
              
                nazmulpcc 5f25bf9
              
                use php fpm service & update caddyfile accordingly
              
              
                nazmulpcc 51e35c3
              
                remove laravel octane
              
              
                nazmulpcc bf7af69
              
                fix queue command & caddy volume
              
              
                nazmulpcc File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| vendor | ||
| .idea | ||
| node_modules | ||
| *.log | ||
| .git | ||
| Dockerfile | ||
| docker-compose.* | ||
| .DS_Store | ||
| storage/app/* | ||
| storage/debugbar/* | ||
| public/build | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| {$APP_DOMAIN} { | ||
| log | ||
| encode zstd gzip | ||
| root * /app/public | ||
| 
     | 
||
| php_fastcgi app:9000 { | ||
| try_files {path} index.php =404 | ||
| } | ||
| 
     | 
||
| file_server | ||
| 
     | 
||
| header { | ||
| Referrer-Policy no-referrer-when-downgrade | ||
| Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" | ||
| X-Xss-Protection "1; mode=block" | ||
| X-Content-Type-Options "nosniff" | ||
| X-Frame-Options "SAMEORIGIN" | ||
| Content-Security-Policy "upgrade-insecure-requests" | ||
| 
     | 
||
| -X-Powered-By | ||
| -Server | ||
| } | ||
| 
     | 
||
| tls {$CERTIFICATE_MODE:internal} | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| FROM php:8.2-cli-alpine AS builder | ||
| 
     | 
||
| WORKDIR /app | ||
| 
     | 
||
| RUN apk update && \ | ||
| apk add --no-cache \ | ||
| linux-headers \ | ||
| curl-dev \ | ||
| gmp-dev \ | ||
| libxml2-dev \ | ||
| libpng-dev \ | ||
| freetype-dev \ | ||
| libjpeg-turbo-dev \ | ||
| libwebp-dev \ | ||
| gcc g++ \ | ||
| autoconf \ | ||
| make \ | ||
| openssl-dev \ | ||
| libzip-dev \ | ||
| icu icu-dev && \ | ||
| docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ > /dev/null 2>&1 && \ | ||
| docker-php-ext-install bcmath pdo_mysql gd sockets zip pcntl intl && \ | ||
| echo "Installing redis extension..." && pecl install redis > /dev/null 2>&1 && \ | ||
| echo "Installing openswoole extension..." && \ | ||
| pecl install -D 'enable-openssl="yes" enable-sockets="yes" enable-hook-curl="yes" enable-http2="yes" enable-mysqlnd="yes" with-postgres="no"' openswoole > /dev/null 2>&1 && \ | ||
| wget -q https://getcomposer.org/composer-2.phar -O /usr/local/bin/composer \ | ||
| && chmod +x /usr/local/bin/composer | ||
| 
     | 
||
| COPY composer.json composer.lock /app/ | ||
| 
     | 
||
| RUN composer install \ | ||
| --ignore-platform-reqs \ | ||
| --no-ansi \ | ||
| --no-autoloader \ | ||
| --no-dev \ | ||
| --no-interaction \ | ||
| --no-scripts | ||
| 
     | 
||
| COPY . /app | ||
| 
     | 
||
| RUN composer dump-autoload --no-ansi --no-dev --no-interaction --optimize | ||
| 
     | 
||
| FROM node:22-alpine AS node | ||
| WORKDIR /app | ||
| COPY package.json package-lock.json /app/ | ||
| RUN npm install --no-audit --no-fund | ||
| COPY . /app | ||
| RUN npm run build | ||
| 
     | 
||
| FROM php:8.2-fpm-alpine | ||
| WORKDIR /app | ||
| 
     | 
||
| COPY --from=builder /usr/local/lib/php/extensions /usr/local/lib/php/extensions | ||
| 
     | 
||
| RUN apk add --no-cache icu-dev libpng-dev freetype-dev libjpeg-turbo-dev libzip-dev && \ | ||
| docker-php-ext-enable intl redis bcmath pdo_mysql gd sockets pcntl zip && \ | ||
| docker-php-ext-enable --ini-name z-openswoole.ini openswoole && \ | ||
| chown -R www-data:www-data /app/ | ||
| 
     | 
||
| COPY --from=builder /usr/local/bin/composer /usr/local/bin/composer | ||
| COPY --from=builder /app /app | ||
| COPY --from=node /app/public/build /app/public/build | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| FROM caddy:2.10-alpine | ||
| 
     | 
||
| COPY Caddyfile /etc/caddy/Caddyfile | ||
| 
     | 
||
| COPY --from=geezap/app:latest /app /app | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| services: | ||
| mysql: | ||
| restart: always | ||
| image: mariadb:11.8.2-noble | ||
| environment: | ||
| - MARIADB_DATABASE=${DB_DATABASE} | ||
| - MARIADB_USER=${DB_USERNAME} | ||
| - MARIADB_PASSWORD=${DB_PASSWORD} | ||
| - MARIADB_ROOT_PASSWORD=${DB_PASSWORD} | ||
| volumes: | ||
| - mysql:/var/lib/mysql | ||
| 
     | 
||
| app: | ||
| build: | ||
| context: . | ||
| restart: always | ||
| env_file: | ||
| - ./.env | ||
| image: geezap/app:latest | ||
| depends_on: | ||
| - redis | ||
| - mysql | ||
| volumes: | ||
| - ./storage:/app/storage | ||
| - ./storage/app/public:/app/public/storage | ||
| 
     | 
||
| worker: | ||
| restart: always | ||
| env_file: | ||
| - ./.env | ||
| image: geezap/app:latest | ||
| command: php artisan horizon | ||
| volumes: | ||
| - ./storage:/app/storage | ||
| 
     | 
||
| scheduler: | ||
| restart: always | ||
| env_file: | ||
| - ./.env | ||
| image: geezap/app:latest | ||
| command: php artisan schedule:work | ||
| volumes: | ||
| - ./storage:/app/storage | ||
| 
     | 
||
| caddy: | ||
| build: | ||
| dockerfile: caddy.Dockerfile | ||
| image: geezap/caddy:latest | ||
| restart: always | ||
| ports: | ||
| - "80:80" | ||
| - "443:443" | ||
| environment: | ||
| - APP_DOMAIN=${APP_DOMAIN} | ||
| - CERTIFICATE_MODE=${CERTIFICATE_MODE} | ||
| volumes: | ||
| - caddy:/data | ||
| - ./storage/app/public:/app/public/storage | ||
| depends_on: | ||
| - app | ||
| networks: | ||
| default: | ||
| aliases: | ||
| - ${APP_DOMAIN} | ||
| logging: | ||
| options: | ||
| max-size: "200mb" | ||
| max-file: "10" | ||
| 
     | 
||
| redis: | ||
                
      
                  nazmulpcc marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| restart: always | ||
| image: redis:7.4.4-alpine | ||
| 
     | 
||
| volumes: | ||
| mysql: | ||
| caddy: | ||
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.