Skip to content
Draft
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
7 changes: 7 additions & 0 deletions 2-docker-nginx-with-database/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
APP_DOMAIN=your-domain.com
DB_DATABASE=solidtime
DB_USERNAME=solidtime
FORWARD_APP_PORT=8000
FORWARD_DB_PORT=5432
DB_PASSWORD=randompassword
SOLIDTIME_IMAGE_TAG=latest
6 changes: 6 additions & 0 deletions 2-docker-nginx-with-database/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/logs
!/logs/.gitkeep
/app-storage
!/app-storage/.gitkeep
.env
laravel.env
104 changes: 104 additions & 0 deletions 2-docker-nginx-with-database/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
services:
app:
restart: always
image: "solidtime/solidtime:${SOLIDTIME_IMAGE_TAG:-latest}"
user: "1000:1000"
networks:
- internal
volumes:
- "app-storage:/var/www/html/storage"
- "./logs:/var/www/html/storage/logs"
- "./app-storage:/var/www/html/storage/app"
environment:
CONTAINER_MODE: http
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:8000/health-check/up || exit 1" ]
env_file:
- laravel.env
depends_on:
- database
scheduler:
restart: always
image: "solidtime/solidtime:${SOLIDTIME_IMAGE_TAG:-latest}"
user: "1000:1000"
networks:
- internal
volumes:
- "app-storage:/var/www/html/storage"
- "./logs:/var/www/html/storage/logs"
- "./app-storage:/var/www/html/storage/app"
environment:
CONTAINER_MODE: scheduler
healthcheck:
test: [ "CMD-SHELL", "supervisorctl status scheduler:scheduler_00" ]
env_file:
- laravel.env
depends_on:
- database
queue:
restart: always
image: "solidtime/solidtime:${SOLIDTIME_IMAGE_TAG:-latest}"
user: "1000:1000"
networks:
- internal
volumes:
- "app-storage:/var/www/html/storage"
- "./logs:/var/www/html/storage/logs"
- "./app-storage:/var/www/html/storage/app"
environment:
CONTAINER_MODE: worker
WORKER_COMMAND: "php /var/www/html/artisan queue:work"
healthcheck:
test: [ "CMD-SHELL", "supervisorctl status worker:worker_00" ]
env_file:
- laravel.env
depends_on:
- database
database:
restart: always
image: 'postgres:15'
# ports:
# - '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'database-storage:/var/lib/postgresql/data'
networks:
- internal
healthcheck:
test:
- CMD
- pg_isready
- '-q'
- '-d'
- '${DB_DATABASE}'
- '-U'
- '${DB_USERNAME}'
retries: 3
timeout: 5s
gotenberg:
image: gotenberg/gotenberg:8
networks:
- internal
healthcheck:
test: [ "CMD", "curl", "--silent", "--fail", "http://localhost:3000/health" ]
nginx:
image: "nginx:latest"
restart: always
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- internal
depends_on:
- app

networks:
internal:
volumes:
database-storage:
app-storage:
46 changes: 46 additions & 0 deletions 2-docker-nginx-with-database/laravel.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
APP_NAME="solidtime"
VITE_APP_NAME="solidtime"
APP_ENV="production"
APP_DEBUG="false"
APP_URL="http://your-domain.com"
APP_FORCE_HTTPS="false"
TRUSTED_PROXIES="0.0.0.0/0,2000:0:0:0:0:0:0:0/3"

# Authentication
APP_KEY=""
PASSPORT_PRIVATE_KEY=""
PASSPORT_PUBLIC_KEY=""
SUPER_ADMINS=""

# Logging
LOG_CHANNEL="stderr_daily"
LOG_LEVEL="debug"

# Database
DB_CONNECTION="pgsql"
DB_HOST="database"
DB_PORT="5432"
DB_SSLMODE="require"
DB_DATABASE="solidtime"
DB_USERNAME="solidtime"
DB_PASSWORD="randompassword"

# Mail
MAIL_MAILER="smtp"
MAIL_HOST=""
MAIL_PORT=""
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="solidtime"
MAIL_USERNAME=""
MAIL_PASSWORD=""

# Queue
QUEUE_CONNECTION="database"

# File storage
FILESYSTEM_DISK="local"
PUBLIC_FILESYSTEM_DISK="public"

# Services
GOTENBERG_URL="http://gotenberg:3000"
12 changes: 12 additions & 0 deletions 2-docker-nginx-with-database/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80;
server_name localhost;

location / {
proxy_pass http://app:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}