BookYourPTO can be deployed in minutes using Docker and Docker Compose. This guide walks you through cloning the repository, configuring environment variables, and starting your application.
Before you begin, ensure you have the following installed on your system:
If you need to install Docker, visit the official Docker installation guide.
Clone the BookYourPTO repository from GitHub:
git clone https://github.com/anhourtec/BookYourPTO.git
cd BookYourPTO
Important: Before deployment, change the default PostgreSQL password in docker-compose.yml:
Open docker-compose.yml and locate the postgres service:
postgres:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres123 # Change this to a strong password
POSTGRES_DB: bookyourpto
Change postgres123 to a strong, unique password. You'll need this password in the next step.
Create a .env file in the root directory with your configuration:
# Database connection - Update password to match docker-compose.yml
DATABASE_URL="postgresql://postgres:YOUR_STRONG_PASSWORD@postgres:5432/bookyourpto"
# JWT Secrets - CHANGE THESE!
JWT_SECRET="production-jwt-secret-minimum-32-characters-change-me"
REFRESH_SECRET="production-refresh-secret-different-from-jwt-also-32-chars"
# Application environment
NODE_ENV="production"
Important Security Notes:
YOUR_STRONG_PASSWORD with the same password you set in docker-compose.ymlJWT_SECRET and REFRESH_SECRET to unique, random strings of at least 32 charactersAlso update the DATABASE_URL in two places in docker-compose.yml:
app:
build:
args:
DATABASE_URL: postgresql://postgres:YOUR_STRONG_PASSWORD@postgres:5432/bookyourpto
environment:
DATABASE_URL: postgresql://postgres:YOUR_STRONG_PASSWORD@postgres:5432/bookyourpto
Build the Docker images:
docker-compose build
This command compiles the application and prepares all dependencies inside Docker containers.
Launch the application stack with Docker Compose:
docker-compose up -d
The -d flag runs containers in detached mode (background). Docker Compose will start two services:
Check that both containers are running:
docker-compose ps
You should see output similar to:
Name Command State Ports
--------------------------------------------------------------------------------
bookyourpto-app docker-entrypoint.sh Up 0.0.0.0:3010->
npm r ... 3000/tcp
bookyourpto-postgres docker-entrypoint.sh Up (healthy) 5432/tcp
Monitor real-time logs from both containers:
docker-compose logs -f
A successful deployment will show:
✓ Database is ready!
✓ Database initialization completed successfully!
✓ Application is ready to start.
Listening on http://0.0.0.0:3000
Press Ctrl+C to exit log viewing (containers will keep running).
Once deployed, BookYourPTO will be available at:
http://localhost:3010
The application runs on port 3000 inside the container but is mapped to port 3010 on your host machine.
After completing the installation, you should have updated:
Now that BookYourPTO is running, you can:
For production environments:
postgres_data volume