Documentation Index
Fetch the complete documentation index at: https://phalanetwork.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Step 1:
Option A: Use Our Example Application
Create a new directory for your project:
mkdir ~/my-first-dstack-app
cd ~/my-first-dstack-app
Create a simple Python Flask application:
# app.py
from flask import Flask, jsonify
import os
import socket
app = Flask(__name__)
@app.route('/')
def hello():
return jsonify({
'message': 'Hello from dstack! 🔒',
'secure': 'Running in a Trusted Execution Environment',
'hostname': socket.gethostname(),
'environment': os.environ.get('DSTACK_ENV', 'production')
})
@app.route('/health')
def health():
return jsonify({'status': 'healthy'}), 200
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)
Create a requirements file:
# requirements.txt
flask==3.0.0
gunicorn==21.2.0
Create a Dockerfile:
# Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
EXPOSE 8080
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "2", "app:app"]