This project was implemented for a simple deployment to the server Some of the ideas of the implementation were taken from the this repo(I have nothing to do with this repository)
- Strapi 4.21.1
- Node.js 18
- Yarn package manager
- Next.js 14.1.4
- React 18
- Tailwind CSS
- TypeScript
- Npm package manager
- Postgres 16.2-alpine
- Nginx Latest
The proxy is split into a domain for Next.js and a subdomain for Strapi
- Docker 26.0.0🐳
- Docker Compose 2.26.0
- Seperated Dockerfiles for development and production
- One file for backend + frontend + database + nginx
- Clone the repository
- Add Environment Variables from
.env.example
to your sever or CI/CD - Change credentials with secure and strong ones
- If you are on development, be sure ENVIRONMENT=development
- If you are on production or want to production build, change with ENVIRONMENT=production
- Be sure localhost:443 is accesible and not using from another process (Nginx runs on 443). You need have SSL on your server.
- Change the domain names in the nginx configuration files and
backend/config/server.js
I Recommend to use CI/CD for easy deploy this project to your server. You can use Gitlab CI/CD or Github Actions for this.
For Gitlab CI/CD, you can rename .gitlab-ci.yml.example
file add runner and deploy this project to your server.