This template provides two methods to get started with Kottster:
- Option 1: Using Docker Compose (recommended for most users)
- Option 2: Using Docker commands directly
Both the Dockerfile
and docker-compose.yml
are already included in the repository for your convenience.
git clone https://github.com/kottster/kottster-template-js my-kottster-app
cd my-kottster-app
docker-compose up -d
IMPORTANT: The
-d
flag is crucial as it runs the container in detached mode (background). Without this flag, your terminal will be locked to the container's output, and you won't be able to run the next command to start the application.
Development mode:
docker exec -it my-kottster-container /dev.sh
Production mode:
docker exec -it my-kottster-container /prod.sh
Stop the container:
docker-compose down
View container logs:
docker-compose logs
git clone https://github.com/kottster/kottster-template-js my-kottster-app
cd my-kottster-app
docker build -t my-kottster-app .
docker run -d --name my-kottster-container \
-p 5480:5480 -p 5481:5481 \
-v $(pwd):/app \
-v /app/node_modules \
my-kottster-app
Here's what each flag does:
-d
- Run the container in the background--name my-kottster-container
- Assign a name to the container-p 5480:5480 -p 5481:5481
- Map the container ports to the host machine-v $(pwd):/app
- Mount the current directory to the/app
directory in the container-v /app/node_modules
- Mount thenode_modules
directory to the container
Development mode:
docker exec -it my-kottster-container /dev.sh
Production mode:
docker exec -it my-kottster-container /prod.sh
Stop the container:
docker stop my-kottster-container
Remove the container:
docker rm my-kottster-container
View container logs:
docker logs my-kottster-container
The container is configured to synchronize your local codebase with the container. Any changes made to your local files will be immediately reflected in the running application.
Edit the ports
section in your docker-compose.yml
file:
ports:
- "<host-port>:5480"
- "<host-port>:5481"
Modify the -p
flags in the Docker run command:
docker run -d --name my-kottster-container \
-p <host-port>:5480 -p <host-port>:5481 \
-v $(pwd):/app \
-v /app/node_modules \
my-kottster-app