Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03ebaa7

Browse files
committed
Move existing example to general and the add example for laravel setup tested with Laravel 12+
1 parent64dbd31 commit03ebaa7

File tree

30 files changed

+1333
-0
lines changed

30 files changed

+1333
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎example/laravel/.env.example‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
6+
APP_LOCALE=en
7+
APP_FALLBACK_LOCALE=en
8+
APP_FAKER_LOCALE=en_US
9+
10+
APP_MAINTENANCE_DRIVER=file
11+
# APP_MAINTENANCE_STORE=database
12+
13+
PHP_CLI_SERVER_WORKERS=4
14+
15+
BCRYPT_ROUNDS=12
16+
17+
LOG_CHANNEL=stack
18+
LOG_STACK=single
19+
LOG_DEPRECATIONS_CHANNEL=null
20+
LOG_LEVEL=debug
21+
22+
SESSION_DRIVER=database
23+
SESSION_LIFETIME=120
24+
SESSION_ENCRYPT=false
25+
SESSION_PATH=/
26+
SESSION_DOMAIN=null
27+
28+
BROADCAST_CONNECTION=log
29+
30+
31+
VITE_APP_NAME="${APP_NAME}"
32+
33+
34+
DB_CONNECTION=mysql
35+
DB_HOST=db
36+
DB_PORT=3306
37+
DB_DATABASE=laravel
38+
DB_USERNAME=local_laravel
39+
DB_PASSWORD=local@laravel
40+
41+
REDIS_CLIENT=phpredis
42+
REDIS_HOST=redis
43+
REDIS_PASSWORD=null
44+
REDIS_PORT=6379
45+
46+
MAIL_MAILER=log
47+
MAIL_SCHEME=null
48+
MAIL_HOST=mail
49+
MAIL_PORT=1025
50+
MAIL_USERNAME=null
51+
MAIL_PASSWORD=null
52+
MAIL_FROM_ADDRESS="hello@example.com"
53+
MAIL_FROM_NAME="${APP_NAME}"
54+
55+
AWS_ACCESS_KEY_ID=minioadmin
56+
AWS_SECRET_ACCESS_KEY=minioadmin
57+
AWS_DEFAULT_REGION=us-east-1
58+
AWS_BUCKET=laravel-bucket
59+
AWS_USE_PATH_STYLE_ENDPOINT=true
60+
AWS_ENDPOINT=http://s3:9000
61+
62+
MEMCACHED_HOST=memcached
63+
64+
CACHE_STORE=memcached
65+
66+
QUEUE_CONNECTION=redis
67+
68+
FILESYSTEM_DISK=s3
69+
70+
APP_URL=https://laravel.localhost
71+
COMPOSE_BAKE=true

‎example/laravel/Caddyfile‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
laravel.localhost {
2+
reverse_proxylocalhost:3002
3+
tls internal
4+
}
5+
6+
hmr.localhost {
7+
reverse_proxylocalhost:5173
8+
tls internal
9+
}
10+
11+
mail.localhost {
12+
reverse_proxylocalhost:8025
13+
tls internal
14+
}
15+
16+
storage.localhost {
17+
reverse_proxylocalhost:5053
18+
tls internal
19+
}
20+
21+
phpmyadmin.localhost {
22+
reverse_proxylocalhost:8080
23+
tls internal
24+
}

‎example/laravel/bootstrap/app.php‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
useIlluminate\Foundation\Application;
4+
useIlluminate\Foundation\Configuration\Exceptions;
5+
useIlluminate\Foundation\Configuration\Middleware;
6+
7+
return Application::configure(basePath:dirname(__DIR__))
8+
// ..other configuration
9+
->withMiddleware(function (Middleware$middleware) {
10+
$middleware->trustProxies(at:'*');
11+
})
12+
// ... other configuration
13+
->withExceptions(function (Exceptions$exceptions) {
14+
//
15+
})->create();
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Laravel Staging Environment
2+
# This docker-compose configuration sets up a staging stack for Laravel applications
3+
4+
services:
5+
#Database Service - PostgreSQL for persistent data storage
6+
db:
7+
image:postgres:17
8+
container_name:staging_laravel_db
9+
restart:always
10+
tty:true
11+
volumes:
12+
-../staging-data/postgres:/var/lib/postgresql/data
13+
expose:
14+
-"5432"
15+
environment:
16+
POSTGRES_DB:${DB_DATABASE:-laravel}
17+
POSTGRES_USER:${DB_USERNAME:-laravel}
18+
POSTGRES_PASSWORD:${DB_PASSWORD:-laravel}
19+
labels:
20+
org.opencontainers.image.title:"postgres"
21+
org.opencontainers.image.environment:"staging"
22+
networks:
23+
-staging_laravel_network
24+
25+
#PHP Service - Main Laravel application running on PHP-FPM
26+
app:
27+
build:
28+
context:.
29+
dockerfile:./docker/staging/php/Dockerfile
30+
container_name:staging_laravel_app
31+
restart:always
32+
tty:true
33+
working_dir:/var/www/app
34+
expose:
35+
-"9000"
36+
command:["php-fpm"]
37+
networks:
38+
-staging_laravel_network
39+
volumes:
40+
-staging_laravel_public:/var/www/app/public
41+
labels:
42+
org.opencontainers.image.title:"laravel"
43+
org.opencontainers.image.environment:"staging"
44+
depends_on:
45+
-db
46+
-redis
47+
-memcached
48+
-s3
49+
-bootstrapper
50+
51+
# Redis service - Cache and queue service
52+
redis:
53+
image:"redis:7"
54+
container_name:staging_laravel_redis
55+
restart:always
56+
tty:true
57+
environment:
58+
ALLOW_EMPTY_PASSWORD:"no"
59+
REDIS_PASSWORD:${REDIS_PASSWORD:-""}
60+
expose:
61+
-"6379"
62+
volumes:
63+
-../staging-data/redis:/data
64+
labels:
65+
org.opencontainers.image.title:"redis"
66+
org.opencontainers.image.environment:"staging"
67+
networks:
68+
-staging_laravel_network
69+
70+
# Worker process manager - Manages Laravel queue workers and scheduled tasks
71+
supervisor:
72+
build:
73+
context:.
74+
dockerfile:./docker/staging/supervisor/Dockerfile
75+
container_name:staging_laravel_supervisor
76+
restart:always
77+
tty:true
78+
volumes:
79+
-staging_laravel_public:/var/www/app/public
80+
-../staging-data/storage:/var/www/storage:rw
81+
labels:
82+
org.opencontainers.image.title:"supervisor"
83+
org.opencontainers.image.environment:"staging"
84+
depends_on:
85+
-app
86+
-db
87+
-redis
88+
-memcached
89+
-s3
90+
networks:
91+
-staging_laravel_network
92+
93+
# Nginx Web Server - Handles HTTP requests and serves static files
94+
nginx:
95+
build:
96+
context:.
97+
dockerfile:./docker/staging/nginx/Dockerfile
98+
container_name:staging_laravel_nginx
99+
restart:always
100+
tty:true
101+
ports:
102+
# - "80:80"
103+
-"3002:80"
104+
# - "443:443"
105+
volumes:
106+
-staging_laravel_public:/var/www/app/public
107+
-/etc/nginx/ssl:/etc/nginx/ssl
108+
labels:
109+
org.opencontainers.image.title:"nginx"
110+
org.opencontainers.image.environment:"staging"
111+
depends_on:
112+
-app
113+
-db
114+
-redis
115+
-supervisor
116+
-memcached
117+
-s3
118+
networks:
119+
-staging_laravel_network
120+
121+
# Memcached Service - In-memory object caching system
122+
memcached:
123+
image:memcached:latest
124+
container_name:staging_laravel_memcached
125+
restart:always
126+
command:
127+
---conn-limit=1024
128+
---memory-limit=256
129+
---threads=4
130+
expose:
131+
-"11211"
132+
volumes:
133+
-../staging-data/memcached:/data
134+
labels:
135+
org.opencontainers.image.title:"memcached"
136+
org.opencontainers.image.environment:"staging"
137+
networks:
138+
-staging_laravel_network
139+
s3:
140+
image:minio/minio:latest
141+
container_name:staging_laravel_s3
142+
restart:unless-stopped
143+
environment:
144+
MINIO_ROOT_USER:${AWS_ACCESS_KEY_ID:-minioadmin}
145+
MINIO_ROOT_PASSWORD:${AWS_SECRET_ACCESS_KEY:-minioadmin}
146+
volumes:
147+
-../staging-data/minio:/data
148+
command:server /data --console-address ":9001"
149+
labels:
150+
org.opencontainers.image.title:"minio"
151+
org.opencontainers.image.environment:"staging"
152+
networks:
153+
-staging_laravel_network
154+
bootstrapper:
155+
image:busybox
156+
container_name:staging_laravel_bootstrapper
157+
volumes:
158+
-./public:/from
159+
-staging_laravel_public:/to
160+
command:sh -c "cp -r /from/* /to"
161+
entrypoint:["/bin/sh", "-c"]
162+
restart:"no"
163+
labels:
164+
org.opencontainers.image.title:"bootstrapper"
165+
org.opencontainers.image.environment:"staging"
166+
networks:
167+
-staging_laravel_network
168+
# Docker Networks - Network configuration for container communication
169+
networks:
170+
staging_laravel_network:
171+
driver:bridge
172+
173+
# Global volumes configuration
174+
volumes:
175+
staging_laravel_public:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp