Skip to content

Post-Initialization

After running graft init, your project is ready for configuration. The most important step is setting up your graft-compose.yml file.

The graft-compose.yml is the heart of your project context. It tells Graft how to build, route, and manage your services on the remote server.

Copy your service definitions from your local docker-compose.yml into graft-compose.yml. Ensure you include the necessary build context or image names.

services:
web:
build: .
# or
# image: myapp:latest

Graft uses Traefik for automated SSL and routing. Follow the standard label pattern to expose your services:

services:
web:
labels:
- "traefik.http.routers.myapp.rule=Host(`app.yourdomain.com`)"
- "traefik.http.services.myapp.loadbalancer.server.port=80"

3. Environment Variables & Secret Management

Section titled “3. Environment Variables & Secret Management”

You can define environment variables directly or point to an .env file. Graft will securely sync these to your production server.

services:
web:
environment:
- DATABASE_URL=postgres://user:pass@db:5432/dbname
# or use env_file
env_file:
- .env.production

Once your graft-compose.yml is configured, you’re ready to deploy your project using the graft sync command.