Skip to content

Deployment Guide

This guide covers deploying the Freeze Design webshop to production.

Infrastructure Requirements

Minimum Specifications

Component Specification
CPU 2 vCPU
RAM 4 GB
Storage 50 GB SSD
OS Ubuntu 22.04 LTS

Services Required

  • PostgreSQL 15+
  • Redis 7+
  • RabbitMQ 3.12+
  • Nginx (reverse proxy)
  • Docker (optional)

Docker Deployment

Build Images

# Backend
docker build -t freezedesign/backend:latest ./backend

# Frontend
docker build -t freezedesign/frontend:latest ./frontend

Docker Compose

# docker-compose.prod.yml
version: '3.8'

services:
  backend:
    image: freezedesign/backend:latest
    environment:
      - DEBUG=False
      - SECRET_KEY=${SECRET_KEY}
      - DB_HOST=postgres
    depends_on:
      - postgres
      - redis

  frontend:
    image: freezedesign/frontend:latest
    environment:
      - NEXT_PUBLIC_API_URL=https://api.freezedesign.nl

  postgres:
    image: postgres:15
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
      - "443:443"

Environment Variables

Production Backend

DEBUG=False
SECRET_KEY=<generate-secure-key>
ALLOWED_HOSTS=api.freezedesign.nl
DB_NAME=freezedesign
DB_USER=freezedesign
DB_PASSWORD=<secure-password>
DB_HOST=postgres
SECURE_SSL_REDIRECT=True

Production Frontend

NEXT_PUBLIC_API_URL=https://api.freezedesign.nl/api
NEXT_PUBLIC_SENTRY_DSN=<sentry-dsn>

SSL Configuration

Use Let's Encrypt with Certbot:

certbot --nginx -d api.freezedesign.nl -d www.freezedesign.nl

Database Migrations

docker exec -it backend python manage.py migrate

Static Files

docker exec -it backend python manage.py collectstatic --no-input

Health Checks

Verify deployment:

# Backend health
curl https://api.freezedesign.nl/api/health/

# Frontend
curl https://www.freezedesign.nl/

Rollback Procedure

  1. Identify the last working version
  2. Pull the previous image tag
  3. Restart services
  4. Verify functionality
docker-compose pull
docker-compose up -d