This directory contains Docker configuration files for deploying OpenLaunch using containers.
- Image name:
openlaunch:latest - Container name:
openlaunch
Dockerfile- Multi-stage Docker build configurationdocker-compose.yml- Docker Compose configuration with all environment variablesdocker-entrypoint.sh- Entrypoint script that handles data directory permissions.env- Environment variables configuration file
You can build the Docker image using either Docker Compose or Docker directly:
# Using Docker Compose (recommended)
cd docker
docker-compose build
# Or using Docker directly from the project root
docker build -f docker/Dockerfile -t openlaunch:latest .-
Configure environment variables:
# Edit docker/.env with your actual values # Ensure you set your IPFS credentials (Pinata or Filebase)
-
Build and run with Docker Compose:
cd docker docker-compose up -dNote: The data directory will be automatically created and permissions will be handled by the container's entrypoint script.
-
Access the application: Open http://localhost:3000 in your browser
-
Create environment file:
cp docker/.env.example .env # Edit .env with your actual values -
Run the container:
docker run -d \ --name openlaunch \ -p 3000:3000 \ --env-file .env \ -v $(pwd)/data:/app/data \ openlaunch:latest
docker run -d \
--name openlaunch \
-p 3000:3000 \
-e FILEBASE_API_KEY="your_filebase_key" \
-e DATA_DIR="./data" \
-e ENABLE_CRON="true" \
-e NODE_ENV="production" \
-v $(pwd)/data:/app/data \
openlaunch:latestYou must configure at least one IPFS service:
Option 1: Pinata
PINATA_API_KEY- Your Pinata API keyPINATA_SECRET_KEY- Your Pinata secret key
Option 2: Filebase
FILEBASE_API_KEY- Your Filebase API key
Most environment variables have sensible defaults. See docker/.env for the complete list.
The SQLite database is stored in /app/data inside the container, which is mounted to a directory on your host machine.
- Host path: Configured via
DATA_DIRenvironment variable (default:docker/data/openlaunch.db) - Container path:
/app/data/openlaunch.db
You can customize the data directory by setting DATA_DIR in your .env file:
# In docker/.env
DATA_DIR=/custom/path/to/dataNote: When using Docker Compose, DATA_DIR controls the host-side mount path. The path is relative to the docker-compose.yml file location unless you specify an absolute path.
To backup your database:
# From the docker directory
cp data/openlaunch.db data/openlaunch-backup-$(date +%Y%m%d-%H%M%S).dbTo restore a database:
# From the docker directory
cp data/openlaunch-backup.db data/openlaunch.dbThe container automatically handles data directory permissions through an entrypoint script:
- The container starts as root to fix permissions if needed
- The entrypoint script changes ownership of
/app/datato thenodeuser (uid 1000) - The container then switches to the
nodeuser before starting the application
This ensures the database can be created and accessed properly, even when Docker Compose creates the directory as root.
The Docker configuration includes a health check that calls /api/init to verify the application is running properly.
- Database Backups: Regularly backup the
docker/datadirectory - Environment Security: Never commit
.envfiles with real API keys - Resource Limits: Consider setting memory and CPU limits in production
- Reverse Proxy: Use nginx or similar for SSL termination and load balancing
- Monitoring: Set up monitoring for the health check endpoint
- Data Directory: Ensure the
docker/datadirectory is included in your backup strategy and excluded from version control
- Permission Errors: The entrypoint script automatically fixes permissions. If you still encounter issues:
- Check that the container has permission to modify the mounted directory
- Verify the container logs:
docker logs openlaunch - Look for the message
[Entrypoint] Fixing permissions on /app/data directory...
- Database Not Found: The database is automatically created on first run if it doesn't exist
- Initialization Failures: Check container logs with
docker logs openlaunchordocker compose -f docker/docker-compose.yml logs
Verify your IPFS service credentials are correctly set in the environment variables.
If port 3000 is already in use, change the port mapping in docker-compose.yml:
ports:
- "8080:3000" # Change host port to 8080Or if using docker run:
docker run -p 8080:3000 openlaunch:latestFor development, you can mount the source code and use hot reloading:
docker run -d \
--name openlaunch-dev \
-p 3000:3000 \
-v $(pwd):/app \
-v /app/node_modules \
-v /app/.next \
--env-file .env \
openlaunch:latest \
npm run devNote: This requires additional configuration and is not recommended for production deployments.