-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from tighten/feat/onboarding-sail
Onboarding Sail (docker)
- Loading branch information
Showing
7 changed files
with
233 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
npm-debug.log | ||
yarn-error.log | ||
.env | ||
auth.json | ||
/.phpunit.cache | ||
/.phpunit.result.cache | ||
.php_cs.cache | ||
|
This file contains 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
## Local Installation | ||
|
||
### MacOS - Valet | ||
1. Clone the repo (`git clone [email protected]:tighten/ozzie.git && cd ozzie`) | ||
2. Install dependencies (`composer install && npm install`) | ||
3. Run `valet secure` to use `https` for the local domain | ||
|
@@ -18,13 +19,50 @@ | |
- Application Name: `Local Ozzie` | ||
- Homepage URL: `https://ozzie.test` | ||
- Application Description: `Local Version of Ozzie` | ||
- Authorization Callback URL: `http://ozzie.test/auth/callback` | ||
- Authorization Callback URL: `https://ozzie.test/auth/callback` | ||
4. Copy the example `.env` file: `cp .env.example .env` and modify its settings to match your local install, including the client ID and secret from the previous step | ||
5. Run `php artisan key:generate` | ||
6. Create a database (by default `.env` looks for one named `ozzie`) and run the migrations (`php artisan migrate`) | ||
7. Fetch the projects list (into the database) by using the `projects:fetch` command. Alternatively, you can seed your `projects` table using a `projects.json` file at the root of the project (see below for more info). | ||
9. Fetch all projects' stats for the first time using `stats:fetch` | ||
|
||
### Sail - Docker | ||
|
||
*ensure you have docker installed and running* | ||
|
||
For the following steps, you'll need to have the `sail` command available. You can alias it by running: | ||
```shell | ||
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail' | ||
``` | ||
[For more info around aliasing check this part of the docs](https://laravel.com/docs/10.x/sail#configuring-a-shell-alias) | ||
|
||
1. Clone the repo (`git clone [email protected]:tighten/ozzie.git && cd ozzie`) | ||
2. Install dependencies | ||
|
||
```shell | ||
docker run --rm \ | ||
-u "$(id -u):$(id -g)" \ | ||
-v "$(pwd):/var/www/html" \ | ||
-w /var/www/html \ | ||
laravelsail/php82-composer:latest \ | ||
composer install --ignore-platform-reqs | ||
``` | ||
|
||
```shell | ||
sail npm install | ||
``` | ||
|
||
3. Create a [GitHub OAuth Application](https://github.com/settings/developers). If you use Valet to serve your application locally, you can use the following settings: | ||
- Application Name: `Local Ozzie` | ||
- Homepage URL: `http://localhost` | ||
- Application Description: `Local Version of Ozzie` | ||
- Authorization Callback URL: `http://localhost/auth/callback` | ||
4. Copy the example `.env` file: `cp .env.example .env` and modify its settings to match your local install, including the client ID and secret from the previous step | ||
5. Run `sail artisan key:generate` | ||
6. Run the migrations (`sail artisan migrate`) | ||
7. Fetch the projects list (into the database) by using the `projects:fetch` command. Alternatively, you can seed your `projects` table using a `projects.json` file at the root of the project (see below for more info). | ||
8. Fetch all projects' stats for the first time using `stats:fetch` | ||
> Note: If you're not using a tool like Laravel Valet, run `php artisan serve` and visit your site at http://127.0.0.1:8000; you'll also want to modify your GitHub app settings to use http://127.0.0.1:8000 instead of http://ozzie.test | ||
## Projects and Daily Caching | ||
|
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,55 @@ | ||
services: | ||
ozzie.test: | ||
build: | ||
context: ./vendor/laravel/sail/runtimes/8.2 | ||
dockerfile: Dockerfile | ||
args: | ||
WWWGROUP: '${WWWGROUP}' | ||
image: sail-8.2/app | ||
extra_hosts: | ||
- 'host.docker.internal:host-gateway' | ||
ports: | ||
- '${APP_PORT:-80}:80' | ||
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}' | ||
environment: | ||
WWWUSER: '${WWWUSER}' | ||
LARAVEL_SAIL: 1 | ||
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' | ||
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' | ||
IGNITION_LOCAL_SITES_PATH: '${PWD}' | ||
volumes: | ||
- '.:/var/www/html' | ||
networks: | ||
- sail | ||
depends_on: | ||
- mysql | ||
mysql: | ||
image: 'mysql/mysql-server:8.0' | ||
ports: | ||
- '${FORWARD_DB_PORT:-3306}:3306' | ||
environment: | ||
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' | ||
MYSQL_ROOT_HOST: '%' | ||
MYSQL_DATABASE: '${DB_DATABASE}' | ||
MYSQL_USER: '${DB_USERNAME}' | ||
MYSQL_PASSWORD: '${DB_PASSWORD}' | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 1 | ||
volumes: | ||
- 'sail-mysql:/var/lib/mysql' | ||
- './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' | ||
networks: | ||
- sail | ||
healthcheck: | ||
test: | ||
- CMD | ||
- mysqladmin | ||
- ping | ||
- '-p${DB_PASSWORD}' | ||
retries: 3 | ||
timeout: 5s | ||
networks: | ||
sail: | ||
driver: bridge | ||
volumes: | ||
sail-mysql: | ||
driver: local |
This file contains 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