This repository contains a template for a Dockerised full-stack application using Django, Next.js, and PostgreSQL. It is designed to help new graduates and junior developers build their own full-stack applications.
- Docker installed
-
Clone the repository:
git clone https://github.com/RickWangPerth/dockerised-full-stack-template.git cd dockerised-full-stack-template -
Create a
.envfile in the project root with the following content:POSTGRES_PASSWORD=postgres POSTGRES_USER=postgres POSTGRES_DB=postgres PROJECT_NAME=fullstackproject
-
Ensure
.shfiles use LF EOL: If you encounter issues withno such file or directory, manually change the EOL settings to LF in your IDE:- VSCode: Open the
.shfile, click on theCRLForLFat the bottom right corner, and selectLF.
- VSCode: Open the
-
Build and run the Docker containers:
docker-compose up --build
-
Access the application:
- Frontend: http://localhost:3000
- Backend: http://localhost:8000
- backend: Contains the Django backend.
- frontend: Contains the Next.js frontend.
- data: Contains database data.
- wait-for-postgres.sh: Ensures the backend waits for PostgreSQL to be ready.
- entrypoint.sh: Manages backend initialization tasks.
For detailed instructions, check out the blog post.
Feel free to submit issues and pull requests to improve the project.
This project is licensed under the MIT License. See the LICENSE file for details.