Docker
In today’s world of software development, ensuring that an application works seamlessly on a developer’s machine, in a testing environment, and in production can be a major challenge. The classic “it works on my machine” problem has plagued development teams for years. This is where Docker comes in, and it’s a foundational piece of the SliceFlow ecosystem, designed to make your development and deployment experience smooth, consistent, and predictable.
Your Entire Application Stack in a Box
Imagine being able to package your entire application—not just your code, but also the database, the caching layer, the messaging system, and all the other services it depends on—into a single, self-contained unit. That’s precisely what Docker allows you to do.
SliceFlow provides a comprehensive Docker setup that creates a complete, production-like environment on your local machine with a single command. This isn’t just about running your own code; it’s about spinning up the entire ecosystem that your application needs to thrive.
The Development Powerhouse: compose.yml
For your day-to-day development, SliceFlow includes a compose.yml
file. Think of this as the blueprint for your local development environment. When you run docker compose up
, it’s like an expert crew assembling your entire workshop in minutes. This includes:
- A PostgreSQL Database: The solid foundation for all your application’s data.
- A RabbitMQ Server: The high-speed internal courier for handling asynchronous messaging.
- A Redis Cache: The lightning-fast short-term memory for boosting your application’s performance.
- A Full Identity Provider (Zitadel): A complete, out-of-the-box solution for handling user authentication, just like you’d have in production.
- A Professional Observability Suite: A complete set of tools (Grafana, Prometheus, Loki, Jaeger) that gives you deep insights into how your application is behaving, helping you track down bugs and performance issues with ease.
With this setup, you’re not just running your application in isolation; you’re running it in a rich, fully-featured environment that mirrors what you’ll use in production. This eliminates surprises and makes the transition from development to deployment incredibly smooth.
Getting this entire world up and running is as simple as:
# Start all services in the backgrounddocker compose up -d
And when you’re done for the day, you can tear it all down just as easily:
# Stop all services and clean updocker compose down
Ready for the Big Stage: compose.prod.yml
When it’s time to go live, SliceFlow has you covered with a production-ready Docker configuration. The compose.prod.yml
file is optimized for a real-world deployment scenario. It includes your core infrastructure (PostgreSQL, RabbitMQ, Redis) and the same powerful observability stack, but it’s also designed to run your actual SliceFlow application as a containerized service.
This production setup is built for stability and security. It uses hardened configurations, ensures your data is safely persisted, and is designed to be easily scalable. If your application suddenly gets a surge in traffic, you can scale up the number of running instances with a single command:
# Run the production stack with 3 instances of your APIdocker compose -f compose.prod.yml up -d --scale api=3
By leveraging Docker, SliceFlow provides a powerful, consistent, and reproducible environment for the entire lifecycle of your application. It takes the guesswork out of infrastructure management, so you can focus on what you do best: building incredible software.