From 9252b064fc53b670079f1bd6cb603b3e20a17b79 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Wed, 13 Mar 2024 00:49:32 +0100 Subject: [PATCH] chore: added docker compose file --- README.md | 19 +++---------------- docker-compose.yml | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index fbb0ab4..8735d19 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,8 @@ mkdir data.local cp .env.sample .env echo 'deploys: []' > config.yaml -# Built docker image -docker built . -t phcd - -# Start container -docker run -d \ - --name phcd \ - --restart unless-stopped \ - -p 127.0.0.1:8080:4321 \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v ./data.local:/app/data.local \ - -v ./.env:/app/.env \ - -v ./config.yaml:/app/config.yaml \ - phcd +# Build and start the container +docker compose up -d --build ``` ### Updating @@ -49,9 +38,7 @@ Just pull changes and update the docker image, then use the command from before ```bash git pull -docker stop phcd -docker rm phcd -docker built . -t phcd +docker compose up -d --build ``` ### TODO: Self-Updating diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8779d3b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.8" +services: + phcd: + build: . + image: phcd + container_name: phcd + restart: unless-stopped + ports: + - "8080:4321" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./data.local:/app/data.local + - ./.env:/app/.env + - ./config.yaml:/app/config.yaml