Skip to content

Commit 5403b7e

Browse files
authored
Merge pull request #1852 from ddm14159/add-config-for-staging-deploy
config for stage deploy added
2 parents 2897595 + 548178f commit 5403b7e

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
.env
2+
13
vendor
24
node_modules
5+
6+
storage/logs
7+
storage/app

deploy/stage/nginx.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
server {
2+
listen 80;
3+
server_name _;
4+
5+
root /app/public;
6+
index index.php;
7+
8+
location / {
9+
proxy_pass http://app:80;
10+
proxy_set_header Host $host;
11+
proxy_set_header X-Real-IP $remote_addr;
12+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
13+
proxy_set_header X-Forwarded-Proto $scheme;
14+
}
15+
16+
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
17+
expires 30d;
18+
add_header Cache-Control "public";
19+
access_log off;
20+
}
21+
}

docker-compose.stage.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
env_file:
7+
- .env
8+
depends_on:
9+
db:
10+
condition: service_healthy
11+
expose:
12+
- "80"
13+
volumes:
14+
- app_storage:/app/storage
15+
- app_cache:/app/bootstrap/cache
16+
- public_data:/app/public
17+
restart: unless-stopped
18+
19+
queue:
20+
build:
21+
context: .
22+
dockerfile: Dockerfile
23+
env_file:
24+
- .env
25+
depends_on:
26+
db:
27+
condition: service_healthy
28+
volumes:
29+
- app_storage:/app/storage
30+
- app_cache:/app/bootstrap/cache
31+
command: ["php", "artisan", "queue:work", "--tries=3", "--timeout=300", "--sleep=3"]
32+
restart: unless-stopped
33+
34+
nginx:
35+
image: nginx:alpine
36+
depends_on:
37+
- app
38+
ports:
39+
- "80:80"
40+
volumes:
41+
- ./deploy/stage/nginx.conf:/etc/nginx/conf.d/default.conf:ro
42+
- public_data:/app/public:ro
43+
- app_storage:/app/storage:ro
44+
restart: unless-stopped
45+
46+
db:
47+
image: postgres:16-alpine
48+
environment:
49+
POSTGRES_DB: ${DB_DATABASE}
50+
POSTGRES_USER: ${DB_USERNAME}
51+
POSTGRES_PASSWORD: ${DB_PASSWORD}
52+
volumes:
53+
- pgdata:/var/lib/postgresql/data
54+
healthcheck:
55+
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
56+
interval: 5s
57+
timeout: 3s
58+
retries: 30
59+
restart: unless-stopped
60+
61+
volumes:
62+
pgdata:
63+
app_storage:
64+
app_cache:
65+
public_data:

0 commit comments

Comments
 (0)