Skip to content

Latest commit

 

History

History
185 lines (130 loc) · 5.82 KB

File metadata and controls

185 lines (130 loc) · 5.82 KB
title Docker Compose
sidebar_position 6
tags
docker
compose
containers
alternative

Docker Compose Setup

Overview

Docker Compose is an alternative to the recommended Podman/Quadlet setup. Use it if:

  • You prefer Docker over Podman
  • You need cross-platform support (Linux, macOS, Windows)
  • Your infrastructure is already Docker-native

Note

Podman Quadlet is the recommended, tested setup. These Docker Compose files are maintained on a best-effort basis and may need adjustments.


Prerequisites


Setup

Clone the Project

cd ~/projects
git clone https://github.com/francoism90/stry.git
cd stry

Build the Application Image

Docker only picks up .dockerignore from the build context root, so copy the stub into place first — otherwise files like a local .env or vendor/ end up baked into the image:

cp containers/stubs/frankenphp-octane/runtimes/dockerignore .dockerignore
docker build -f containers/stubs/frankenphp-octane/runtimes/Containerfile -t stry:latest .

Create Environment Files

Create the config directory:

mkdir -p containers/config

Required files to populate:

File Purpose
containers/config/app.env Application configuration (see Application Configuration)
containers/config/postgres.env PostgreSQL credentials
containers/config/typesense.env Typesense configuration
containers/config/rustfs.env RustFS S3 storage credentials

Copy .env.example as a template:

cp .env.example containers/config/app.env
vi containers/config/app.env

Usage

docker compose -f containers/docker/docker-compose.yml up -d

The application will be available at http://localhost:8000

For HTTPS/subdomains, terminate TLS with your own reverse proxy in front of :8000 — sibling services (Reverb, RustFS, Mailpit) are already reverse proxied by the app's own embedded Caddy instance, no extra proxy service needed. See Reverse Proxy.


Service Overview

Service names below match the keys in containers/docker/docker-compose.yml — containers are named stry-{service} by Compose (e.g. stry-app).

Service Purpose Port
app Main application server (Octane) 8000
ssr Server-side rendering (Node.js) 13714
queue Background job processor (Horizon)
reverb WebSocket server 6001
schedule Task scheduler
pgsql Database 5432
redis Cache & sessions 6379
typesense Full-text search 8108
rustfs S3-compatible storage 9000-9001
mailpit Development email 8025

Common Commands

# Start / stop / restart
docker compose -f containers/docker/docker-compose.yml up -d
docker compose -f containers/docker/docker-compose.yml down
docker compose -f containers/docker/docker-compose.yml restart

# Logs
docker compose -f containers/docker/docker-compose.yml logs -f app

# Migrations / shell
docker exec stry-app php artisan migrate --force
docker exec -it stry-app /bin/bash

Development Setup

Mount the application directory in docker-compose.yml for live code reloading:

services:
  app:
    volumes:
      - ./:/app:rw
      - /app/vendor # Prevent vendor from mounting
      - /app/node_modules # Prevent node_modules from mounting
    environment:
      APP_ENV: local
      APP_DEBUG: 'true'

Then run Vite from the container:

docker exec -it stry-app pnpm dev

GPU Acceleration

Uncomment the devices block for the queue service in containers/docker/docker-compose.yml:

queue:
  devices:
    - /dev/dri:/dev/dri

Note

Requires VAAPI (Intel), mesa (AMD), or NVENC (Nvidia) drivers on the host — see the hardware encoding docs. GPU passthrough is more limited on Docker Desktop than on native Linux.


Troubleshooting

  • Container won't startdocker compose -f containers/docker/docker-compose.yml logs app
  • Permission deniedsudo chown -R $USER:$USER ~/projects/stry
  • Port already in use — change the host-side port under ports: for that service
  • Database connection failed — check containers/config/postgres.env and docker compose ... ps

Known limitations vs Podman

Docker Compose doesn't have the Podman-specific features the Quadlet setup relies on: UserNS=keep-id (rootless file ownership), AutoUpdate, and systemd-managed lifecycle/autostart. You'll need to manage those yourself.


Next Steps