notes/docker/install.sh
2025-04-27 01:36:29 +09:30

21 lines
531 B
Bash
Executable file

#!/bin/bash
# Remove the existing container
systemctl stop notes.service
systemctl disable notes.service
docker container stop notes-server
docker container rm notes-server
# Build the notes-server image.
docker build --no-cache -t notes-server .
# Run the notes-server image.
docker run -d \
--name notes-server \
-v "${PWD}/../hugo/public:/usr/share/nginx/html" \
-p 42069:80 \
notes-server
# Install and enable the systemctl service.
cp notes.service /etc/systemd/system/notes.service
systemctl enable notes.service