Note
Copyright 2024 - present Ioannis Theodosiadis, SEOULTECH University
This project is licensed under the MIT License. Please note that while the code is open source, the logo and branding of 1oannis.com are proprietary and not covered by the MIT License. See LICENCE file in the project root for details.
This is a Next.js project bootstrapped with shadcn
which houses the personal website of 1oannis.
Important
This project requires at minimum a node.js v20 installation.
In order to speed up the installation process pnpm is used instead of npm.
npm install -g pnpmNow install the dependencies.
pnpm installYou can develop easily on your local machine by using the built-in dev server.
pnpm devIn order to create a production deployment you need to build the project first.
pnpm buildNow you can start the build.
pnpm startTip
Open http://localhost:3000 with your browser to see the result.
This project can be containerized with Docker for easy deployment.
Important
This step requires at minimum a Docker Engine installation.
In order to build an image you only have to specify the tag and correct Dockerfile.
docker build -t the1oannis/homepage:1.0.0 -f ./Dockerfile.prod .For easier accessibility you can forward the port to 80 when you run the container.
docker run -p 80:3000 the1oannis/homepage:1.0.0Tip
Open http://localhost with your browser to see the result.
Note
Notice how you just used a pretty boring and manual way to dockerize an application.
Also take a look at the different Dockerfiles prod / dev
and the docker-compose.yaml in the project root.
Let's say you want to remotely develop on the website and you want to use Docker for that. There is a neat feature called
Compose Watch which basically enables hot-reloading in containers.
In order to make use of that you can simply run the given docker-compose.yaml.
service:
dev:
...
environment:
- WATCHPACK_POLLING=true
...Note
The WATHCPACK_POLLING flag enables the hot-reloading for the deployment.
Deploy the dev container and go to http://localhost.
docker compose up devTip
Watch how the container will rebuild when changes in the files are detected.
You can undeploy the container at any time.
docker compose down devdocker compose up prodImportant
Prod does not allow hot-reload. However it provides a faster way to build and deploy the prod image.
You can undeploy the container at any time.
docker compose down prodTo learn more about the projects techstack, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API
- Learn Next.js - an interactive Next.js tutorial
- Shadcn - a component library for next.js
- Docker - the go to containerization platform
- Learn Docker - learn about the basics of Docker