Railway.app is a cloud platform that can host La Comanda with zero infrastructure management. Railway detects the project’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/LaComanda/llms.txt
Use this file to discover all available pages before exploring further.
Dockerfile automatically, builds the image on every push to your connected GitHub repository, and injects the runtime $PORT variable that La Comanda’s start.sh script uses to configure Apache — no manual server setup required.
Prerequisites
Before deploying, make sure you have:- A free or paid Railway account
- Your La Comanda source code pushed to a GitHub repository
- (Optional) The Railway CLI installed for managing environment variables and running one-off commands from the terminal
Deployment Steps
Dockerfile at the repo root and queue an initial build.MYSQL_HOST, MYSQL_PORT, MYSQL_DATABASE, MYSQL_USER, and MYSQL_PASSWORD — you will map these to La Comanda’s expected variable names in the next step.Navigate to your web service’s Variables tab and add every variable listed in
.env.example. Pay close attention to the database connection variables, which must point to the Railway MySQL service rather than the local db container:DB_HOSTDB_PORT3306 (Railway internal port)DB_NAMEDB_USERDB_PASSWORDAPP_URLhttps://yourapp.up.railway.appBASE_URL/APP_ENVproductionNever use the seeded test passwords in production. Update all user passwords
in the database and in your Railway environment variables after deployment.
Once environment variables are saved, Railway triggers a new build (or you can click Deploy manually). The build process:
Dockerfile.railway/start.sh as the entrypoint.start.sh reads the $PORT variable injected by Railway, writes the correct Listen directive into Apache’s configuration, and starts apache2-foreground.# Forward the Railway MySQL port to your local machine
railway connect mysql
# In another terminal, import the schema
mysql -h 127.0.0.1 -P <local-port> -u <user> -p <database> < db/la_comanda.sql
mysql -h <RAILWAY_MYSQL_HOST> -P <RAILWAY_MYSQL_PORT> \
-u <DB_USER> -p <DB_NAME> < db/la_comanda.sql
Environment Variables for Railway
The table below highlights the key differences between your local.env and the values required on Railway:
| Variable | Local value | Railway value |
|---|---|---|
DB_HOST | db (Docker service name) | Internal Railway MySQL hostname |
DB_PORT | 3306 | 3306 (internal) |
PORT | (not set — defaults to 80) | Injected automatically by Railway — do not set manually |
APP_URL | http://localhost:8080 | https://yourapp.up.railway.app |
BASE_URL | / | / |
APP_ENV | local | production |
The
railway.json file sets restartPolicyType to ON_FAILURE with
maxRetries: 10, so Railway will automatically attempt to restart the
container if it crashes during startup or runtime.How Port Configuration Works
Railway dynamically assigns a port to each deployment and passes it as the$PORT environment variable. La Comanda handles this through railway/start.sh:
| Environment | $PORT value | Apache listens on |
|---|---|---|
| Local Docker Compose | (unset — defaults to 80) | 80 (mapped to host 8080) |
| Railway | Injected dynamically (e.g. 8080, 3000) | Whatever Railway assigns |