devops
- Terraform & Ansible deployment scripts
news_service
- Rust Cron and API services
web
- Next.js frontend
- Docker & Docker Compose
- Twitter API key
- OpenAI API key
# copy the sample .env file
cp .env.sample .env.dev
Set the OPENAI_API_KEY
& TWITTER_BEARER_TOKEN
variables in .env.dev
# start docker
service docker start
# Start the app
docker-compose --env-file ".env.dev" up -d --build
# tail the logs
docker-compose logs --tail="all" -f
# Initialize a docker swarm
sudo docker swarm init
# Deploy the stack
sudo env $(cat .env.dev | xargs) docker stack deploy --compose-file docker-compose.yaml climate_news_stack
# Display stack info
sudo docker stack ps climate_news_stack
# Display service info
sudo docker service ps climate_news_stack_news_cron
# Inspect a service
sudo docker service inspect --pretty climate_news_stack_news_cron
# Restart a service
sudo docker service update --force climate_news_stack_news_cron
# Run a command in a container
sudo docker container ls
sudo docker exec -it f855a1118d35 /bin/bash
# Logs for a service
sudo docker service logs -f --since 1h climate_news_stack_db
sudo docker service logs -f --since 1h climate_news_stack_news_api
sudo docker service logs -f --since 1h climate_news_stack_news_cron
sudo docker service logs -f --since 1h climate_news_stack_web
sudo docker service logs -f --since 1h climate_news_stack_caddy
# Search logs for a service
sudo docker service logs --since 24h climate_news_stack_news_cron 2>&1 | grep "tweet_cron_job"
# Remove the stack
sudo docker stack rm climate_news_stack
sudo docker volume prune
git tag -a v0.0.52 -m "logging update" && git push origin v0.0.52