- Docker Desktop installed
- Docker Compose Command line tool installed
- Clone the repository and navigate to this directory:
cd docker_postgres_db- Create
.envfile with your database credentials:
POSTGRES_USER=trading_user
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=trading_db- Start the database:
docker-compose up -d- Verify the setup:
# Check if container is running
docker ps
# Connect to database
docker exec -it solana_trading_db psql -U trading_user -d trading_db
# Inside psql, verify schema and tables:
\dn # List schemas
\dt sol_algo.* # List tables in sol_algo schemaThe database includes the sol_algo schema with the following tables:
-- Partitioned Tables
sol_algo.pumpfun_trades_partitioned
sol_algo.pumpfun_latest_tokens_partitioned
-- Regular Tables
sol_algo.pumpfun_graduate_detection
sol_algo.pumpswap_migrated_pool
sol_algo.pumpfun_launch_txn
sol_algo.pumpswap_bought_history
sol_algo.pumpfun_bought_historydocker-compose up -ddocker-compose downdocker-compose down
rm -rf data/*
docker-compose up -ddocker logs solana_trading_dbdocker exec -it solana_trading_db psql -U trading_user -d trading_dbIf you encounter permission issues:
# Fix permissions on init scripts
chmod 755 postgres/init-scripts/*Check the logs:
docker logs solana_trading_dbTry rebuilding:
docker-compose down
docker-compose build --no-cache
docker-compose up -ddocker exec -t solana_trading_db pg_dumpall -c -U trading_user > dump_$(date +%Y-%m-%d_%H_%M_%S).sqlcat your_dump.sql | docker exec -i solana_trading_db psql -U trading_user -d trading_db- Never commit
.envfile with real credentials - Change default passwords in production
- Restrict network access in production environments
- Regularly backup your data
Feel free to submit issues and enhancement requests!