Skip to content

10.x #6604

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

Closed
wants to merge 10 commits into from
Closed

10.x #6604

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM php:8.1-fpm

ARG ROOT=/app
ARG APP_ENV
ARG APP_PORT

WORKDIR $ROOT

ENV APP_ENV $APP_ENV
ENV PORT $APP_PORT

# Install and Update Libraries
RUN apt-get update && apt-get install -y autoconf gcc bash g++ make wget unzip libaio1 libaio-dev libxml2 libxml2-dev iputils-ping gettext-base nginx supervisor vim nano gnupg2

# Dockerize Command
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

# Install Sockets
RUN docker-php-ext-install sockets

# Install Postgres
RUN apt-get install -y libpng-dev libpq-dev libzip-dev \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install pgsql pdo pdo_pgsql \
&& docker-php-ext-install gd pcntl zip

# Install Heroku
RUN curl https://cli-assets.heroku.com/install.sh | sh
RUN apt-get update && apt-get install -y jq && apt-get clean

# Install Redis
RUN pecl install -o -f redis \
&& docker-php-ext-enable redis

# Install SOAP
RUN docker-php-ext-install soap

# Copy Composer Instalation
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Copy config files to container
COPY /devops/supervisor/supervisor.conf /etc/supervisord.conf
COPY /devops/nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
COPY /devops/nginx/nginx.conf /etc/nginx/nginx.conf
COPY /devops/php-fpm/php.ini /usr/local/etc/php/conf.d/app.ini
COPY /devops/php-fpm/php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
COPY /devops/php-fpm/error_reporting.ini /usr/local/etc/php/conf.d/error_reporting.ini

COPY .env.example ${ROOT}/.env

COPY ./ $ROOT

RUN if [ "$APP_ENV" = "local" ]; then \
composer install --prefer-dist --optimize-autoloader; \
else \
composer install --prefer-dist --optimize-autoloader --no-dev; \
fi

ADD /devops/scripts/entrypoint.sh /
RUN chmod +x /entrypoint.sh

CMD ["/bin/bash", "-c", "/entrypoint.sh ${PORT}"]
67 changes: 4 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,7 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
# LARAVEL IN CONTAINER FOR HEROKU

<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
## ONE CLICK INSTALL!

## About Laravel
Using the button below, you can get your copy live on [Heroku](https://www.heroku.com/) just using your finger!

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, powerful, and provides tools required for large, robust applications.

## Learning Laravel

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

## Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).

### Premium Partners

- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[OP.GG](https://op.gg)**
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
- **[Lendio](https://lendio.com)**

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

## Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
153 changes: 153 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"name": "Laravel Heroku Template",
"shortName": "LHT",
"description": "Laravel template - Nginx template with supervisor and php-fpm using Docker for Heroku",
"repository": "https://github.com/natemacs",
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Laravel.svg/120px-Laravel.svg.png",
"keywords": [
"nginx",
"heroku",
"container",
"supervisor",
"php",
"fpm",
"template",
"laravel"
],
"stack": "container",
"env": {
"APP_NAME": {
"description": "Application Name.",
"value": "Laravel Heroku"
},
"APP_ENV": {
"description": "Application Enviroment. local|development|production",
"value": "production"
},
"APP_DEBUG": {
"description": "Application Debug. false|true",
"value": "false"
},
"APP_URL": {
"description": "Application URL.",
"value": "localhost"
},
"DB_CONNECTION": {
"description": "Database Connection.",
"value": "pgsql"
},
"BROADCAST_DRIVER": {
"value": "log"
},
"CACHE_DRIVER": {
"value": "redis"
},
"SESSION_DRIVER": {
"value": "file"
},
"SESSION_LIFETIME": {
"value": "120"
},
"FILESYSTEM_DISK": {
"value": "local"
},
"QUEUE_CONNECTION": {
"value": "sync"
},
"MEMCACHED_HOST": {
"value": "127.0.0.1"
},
"REDIS_CLIENT": {
"value": "predis"
},
"MAIL_MAILER": {
"value": "smtp"
},
"MAIL_HOST": {
"value": "smtp.mailtrap.io"
},
"MAIL_PORT": {
"value": "2525"
},
"MAIL_USERNAME": {
"value": "null"
},
"MAIL_PASSWORD": {
"value": "null"
},
"MAIL_ENCRYPTION": {
"value": "null"
},
"MAIL_FROM_ADDRESS": {
"value": "hello@example.com"
},
"MAIL_FROM_NAME": {
"value": "${APP_NAME}"
},
"MAIL_CC_ADDRESS": {
"value": "null"
},
"AWS_ACCESS_KEY_ID": {
"value": "null"
},
"AWS_DEFAULT_REGION": {
"value": "us-east-1"
},
"AWS_BUCKET": {
"value": "",
"required": false
},
"PUSHER_APP_ID": {
"value": "",
"required": false
},
"PUSHER_APP_KEY": {
"value": "",
"required": false
},
"PUSHER_APP_SECRET": {
"value": "",
"required": false
},
"PUSHER_APP_CLUSTER": {
"value": "",
"required": false
}
},
"formation": {
"web": {
"quantity": 1,
"size": "basic"
},
"worker": {
"quantity": 1,
"size": "basic"
}
},
"addons": [
{
"plan": "scheduler:standard",
"as": "SCHEDULER"
},
{
"plan": "heroku-redis:mini",
"as": "REDIS"
},
{
"plan": "papertrail:fixa",
"as": "PAPERTRAIL"
},
{
"plan": "heroku-postgresql:basic",
"as": "DATABASE"
}
],
"environments": {
"development": {
"scripts": {}
},
"production": {
"scripts": {}
}
}
}
73 changes: 73 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
version: '3.9'
services:
web:
build:
context: ./
dockerfile: ./Dockerfile
args:
APP_ENV: ${APP_ENV}
APP_PORT: ${APP_PORT}
container_name: '${APP_NAME}-web'
restart: on-failure
volumes:
- ./:/app
ports:
- '${APP_PORT}:${APP_PORT}'
networks:
- boilerplate-network
extra_hosts:
- host.docker.internal:host-gateway
links:
- "postgres:postgres"
- "cache:cache"
depends_on:
postgres:
condition: service_healthy
cache:
condition: service_healthy
postgres:
image: 'postgres:14.2-alpine'
container_name: '${APP_NAME}-postgres'
restart: always
volumes:
- "./devops/postgres/create_development_database.sql:/docker-entrypoint-initdb.d/create_development_database.sql"
environment:
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD}'
POSTGRES_DB: '${DB_DATABASE}'
ports:
- '${DB_PORT}:5432'
networks:
- boilerplate-network
extra_hosts:
- host.docker.internal:host-gateway
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-U", "root" ]
interval: 10s
timeout: 10s
retries: 3
start_period: 20s
cache:
image: 'redis:7.0-alpine'
container_name: '${APP_NAME}-redis'
restart: always
environment:
- ALLOW_EMPTY_PASSWORD=yes
command: redis-server --appendonly yes
volumes:
- ./data/cache:/data
ports:
- '${REDIS_PORT}:6379'
networks:
- boilerplate-network
extra_hosts:
- host.docker.internal:host-gateway
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 10s
timeout: 10s
retries: 3
start_period: 20s
networks:
boilerplate-network:
driver: bridge
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
"laravel/tinker": "^2.7",
"predis/predis": "^2.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand Down
Loading