(01)Install
Linux
1sudo apt-get install -y redis-server2sudo systemctl enable redis-serverIn-memory data store for caching and sessions
What is this?
Redis stores data in memory for extremely fast reads — ideal for caching and session storage.
Where to create or edit the main configuration — paths below match the setup steps.
/etc/redis/redis.confLocation: Redis server
Bind, persistence, memory, auth
Step 01
1sudo apt-get install -y redis-server2sudo systemctl enable redis-serverStep 02
1sudo nano /etc/redis/redis.conf2# bind 127.0.0.13# requirepass yourpassword4sudo systemctl restart redis-server5redis-cli ping # PONGStep 03
1redis-cli set test hello2redis-cli get testStep 04
1redis-cli info memory2redis-cli monitor3 YAML templates for Redis. Copy and deploy after setup.
3 ready-to-copy templates. Expand one, copy the YAML, then run the deploy commands.
docker-compose.yaml
PostgreSQL database + Flask app with env file and volume persistence
1version: "3.9"2 3services:4 db:5 image: postgres:15-alpine6 environment:7 POSTGRES_DB: dukaan_db8 POSTGRES_USER: dukaan9 POSTGRES_PASSWORD: dukaan12310 ports:11 - "5432:5432"12 volumes:13 - pgdata:/var/lib/postgresql/data14 15 app:16 build: .17 ports:18 - "5000:5000"19 env_file:20 - .env21 depends_on:22 - db23 24volumes:25 pgdata:Dockerfile
Flask application container image
1FROM python:3.12-slim2WORKDIR /app3COPY requirements.txt .4RUN pip install --no-cache-dir -r requirements.txt5COPY . .6EXPOSE 50007CMD ["python", "app.py"]Step 01
1cd your-project/2docker compose up -d --build3docker compose ps4docker compose logs -f app1docker compose down2docker compose down -v # remove volumes