- Docker and Docker Compose installed on your machine
- Firebase project set up
- OpenWeather API key
- Create a
.envfile in the root directory based on.env.example:# Firebase Configuration VITE_FIREBASE_API_KEY=your_firebase_api_key VITE_FIREBASE_PROJECT_ID=your_firebase_project_id VITE_FIREBASE_APP_ID=your_firebase_app_id # OpenWeather Configuration OPENWEATHER_API_KEY=your_openweather_api_key # Database Configuration DATABASE_URL=postgres://postgres:postgres@db:5432/gameon # Environment NODE_ENV=development DOCKER=true
-
Build and start the containers:
npm run docker:dev
-
Initialize the database (first time only):
npm run docker:db:init
-
Access the application:
- Web app: http://localhost:3000
- API: http://localhost:3000/api
- Vite dev server: http://localhost:5000
-
Build and run the production container:
npm run docker:prod
-
Access the production build at http://localhost:3000
- Render account
- Docker Hub account (optional)
- Domain name (optional for custom domain)
- Push your code to a GitHub repository
- In Render dashboard, click "New" and select "Blueprint"
- Connect your GitHub repository
- Render will automatically detect the
render.yamlfile and set up the services - Add your environment variables in the Render dashboard:
- VITE_FIREBASE_API_KEY
- VITE_FIREBASE_PROJECT_ID
- VITE_FIREBASE_APP_ID
- OPENWEATHER_API_KEY
- In Render dashboard, click "New" and select "Web Service"
- Select "Docker" as the environment
- Connect your GitHub repository
- Configure the service:
- Name: gameon
- Root Directory: ./
- Docker Command: leave empty (uses CMD from Dockerfile)
- Add environment variables:
- NODE_ENV: production
- PORT: 3000
- DATABASE_URL: (use Render PostgreSQL internal connection string)
- VITE_FIREBASE_API_KEY: your Firebase API key
- VITE_FIREBASE_PROJECT_ID: your Firebase project ID
- VITE_FIREBASE_APP_ID: your Firebase app ID
- OPENWEATHER_API_KEY: your OpenWeather API key
- Set up a PostgreSQL database in Render
- Link the database to your web service
- In your web service settings, go to "Custom Domain"
- Add your domain name
- Configure DNS records as instructed by Render
- Wait for DNS propagation and SSL certificate issuance
- Verify DATABASE_URL is correctly set
- Check if PostgreSQL service is running
- Ensure database schemas are created
- Check Docker build logs in Render
- Verify all environment variables are set
- Check for any syntax errors in your code
- Check application logs in Render dashboard
- Verify Firebase configuration
- Check for any API rate limiting issues with OpenWeather