🐳 Dockerized Strapi & Next.js Setup
This project provides a Dockerized setup for a Strapi and Next.js application. It enables you to quickly deploy and run a Strapi backend and Next.js frontend together using Docker containers. It also includes an NGINX reverse proxy container for routing requests to the appropriate services.
✨ Easily deploy a Strapi and Next.js application with Docker.
✨ Simplifies the setup process for running both backend and frontend together.
✨ Includes an NGINX reverse proxy for routing requests.
✨ Encourages a consistent development and deployment environment.
⚙️ Docker: Make sure you have Docker installed on your machine.
⚙️ nginxproxy/nginx-proxy: Ensure you have the nginxproxy/nginx-proxy Docker container running in the background to handle reverse proxying.
Example nginx-proxy docker-compose.yml file (this will be used globally by all projects):
version: '3'
services:
nginx-proxy:
image: nginxproxy/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
proxy:
external: trueTo get started with this Dockerized Strapi & Next.js setup, follow these steps:
- Clone the repository:
git clone https://github.com/balatD/strapi-next-docker- Change into the project directory:
cd strapi-next-docker- Rename the .example.env file:
cp .example.env .env- Change the necessary variables inside .env:
PROJECT_NAME=
PROJECT_URL=- Start the containers with the ./start.sh bash script:
./start.sh-
Open your browser and visit
PROJECT_URLto see the Next.js frontend. -
Access the Strapi admin panel at
PROJECT_URL/strapi/admin.
- Auto-install SSL Certificates using https://github.com/nginx-proxy/acme-companion
Workflow (scripts) for adding nmp packages to frontend/backend- MediaRendering in NEXT.js for Strapi images
- NEXT.js fetcher utility class
- Update Next.js and Strapi to latest version
Nginx configuration template rendering (using project_url from .env file)- Documentation
- Ddev-router collision
- Deployment / Server docker-compose configuration with built-in proxying
Cleanup .gitignore
We would like to express our gratitude to the following projects: