Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b9224e7

Browse files
committedApr 26, 2024··
fix: use proper database and debugging configurations
1 parent 7630fde commit b9224e7

File tree

11 files changed

+496
-391
lines changed

11 files changed

+496
-391
lines changed
 

‎.github/workflows/build.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build template
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- name: Build docker image
12+
run: |
13+
docker compose build
14+
docker compose run --rm web composer install
15+
docker compose run --rm web php artisan migrate --force
16+
17+
- name: Run docker container
18+
run: docker compose up -d
19+
20+
- name: Test if service is reachable
21+
run: |
22+
sleep 30
23+
curl -v -s --retry 10 --retry-connrefused http://localhost:8000/
24+
25+
- name: Report error to Sentry
26+
if: failure()
27+
run: |
28+
curl -sL https://sentry.io/get-cli/ | bash
29+
export SENTRY_DSN=${{ secrets.SENTRY_DSN }}
30+
MESSAGE_HEAD='Template: "${{ github.workflow }}" failed in ${{ github.repository }}.'
31+
MESSAGE_BODY='Check <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}> for more details.'
32+
sentry-cli send-event -m "$MESSAGE_HEAD" -m "$MESSAGE_BODY" --log-level=error

‎.github/workflows/deploy.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy template
2+
3+
on:
4+
push:
5+
schedule:
6+
- cron: "10 14 * * *"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install divio-cli
23+
24+
- name: Deploy to Divio
25+
run: |
26+
divio login ${{ secrets.DIVIO_TOKEN }}
27+
divio app deploy test --remote-id ${{ secrets.DIVIO_WEBSITE_ID }} --build-mode FORCE
28+
29+
- name: Test if website is reachable
30+
run: |
31+
curl -v -s --retry 10 --retry-connrefused ${{ secrets.WEBSITE_URL }}
32+
33+
- name: Report error to Sentry
34+
if: failure()
35+
run: |
36+
curl -sL https://sentry.io/get-cli/ | bash
37+
export SENTRY_DSN=${{ secrets.SENTRY_DSN }}
38+
MESSAGE_HEAD='Template: "${{ github.workflow }}" failed in ${{ github.repository }}.'
39+
MESSAGE_BODY='Check <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}> for more details.'
40+
sentry-cli send-event -m "$MESSAGE_HEAD" -m "$MESSAGE_BODY" --log-level=error

‎CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Thank you for contributing! We appreciate your involvement in making this projec
66

77
Proposals can be submitted through:
88

9-
- [Pull Requests](https://github.com/divio/getting-started-with-php-laravel/pulls)
10-
- [Issues](https://github.com/divio/getting-started-with-php-laravel/issues)
9+
- [Pull Requests](https://github.com/divio/getting-started-with-laravel/pulls)
10+
- [Issues](https://github.com/divio/getting-started-with-laravel/issues)
1111

1212
## Pull Requests and Branches
1313

‎Dockerfile

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
FROM php:8.3-apache
1+
FROM php:8.3-fpm
22

33
ENV COMPOSER_ALLOW_SUPERUSER=1
44

55
WORKDIR /var/www/html
6-
76
RUN apt-get update -y && apt-get install -y openssl zip unzip git
8-
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
7+
RUN docker-php-ext-install mysqli pdo pdo_mysql
8+
9+
# install composer
10+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
11+
12+
COPY composer.* /var/www/html/
13+
RUN composer install --no-interaction --no-dev --no-scripts
914

1015
COPY . /var/www/html
11-
RUN composer install --prefer-dist
1216

1317
EXPOSE 80
1418

19+
# generate a custom APP_KEY within your environment variables
20+
ENV APP_KEY=${APP_KEY:-"base64:iwGHg6152clSDBYopOY0WR7NjX7sItBuRNArsnLPlTk="}
21+
1522
CMD ["php", "artisan", "serve", "--host", "0.0.0.0", "--port", "80"]

‎README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Getting Started with Laravel
22

3-
[![Deploy to Divio](https://img.shields.io/badge/DEPLOY-TO%20DIVIO-DFFF67?logo=docker&logoColor=white&labelColor=333333)](https://control.divio.com/app/new/?template_url=https://github.com/divio/getting-started-with-php-laravel/archive/refs/heads/main.zip)
3+
[![Deploy to Divio](https://img.shields.io/badge/DEPLOY-TO%20DIVIO-DFFF67?logo=docker&logoColor=white&labelColor=333333)](https://control.divio.com/app/new/?template_url=https://github.com/divio/getting-started-with-laravel/archive/refs/heads/main.zip)
44

5-
Welcome to our QuickStart template – your portal to swift application development and seamless local testing. Whether you're delving into Laravel for the first time or optimizing your workflow, our template, based on [Creating a Laravel Project](https://laravel.com/docs/10.x/installation#creating-a-laravel-project) guide, has got you covered.
5+
Welcome to our QuickStart template – your portal to swift application development and seamless local testing. Whether you're delving into Laravel for the first time or optimizing your workflow, our template, based on [Creating a Laravel Project](https://laravel.com/docs/master/installation#creating-a-laravel-project) guide, has got you covered.
66

77
## Cloud Setup
88

@@ -21,5 +21,7 @@ Alternatively, build this app locally using Docker:
2121

2222
1. Ensure [Docker](https://docs.docker.com/get-docker/) is installed and running.
2323
2. Run `docker compose build` to build fresh images.
24-
3. Run `docker compose up` to start the project.
25-
4. Open `http://localhost:8000`.
24+
3. Install dependencies using `docker compose run --rm web composer install`.
25+
4. Run migrations through `docker compose run --rm web php artisan migrate`.
26+
5. Run `docker compose up` to start the project.
27+
6. Open `http://localhost:8000`.

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"laravel/sail": "^1.26",
1616
"mockery/mockery": "^1.6",
1717
"nunomaduro/collision": "^8.0",
18-
"phpunit/phpunit": "^10.5",
18+
"phpunit/phpunit": "^11.0.1",
1919
"spatie/laravel-ignition": "^2.4"
2020
},
2121
"autoload": {

0 commit comments

Comments
 (0)
Please sign in to comment.