chore: working dockerfile

main
Antonio De Lucreziis 10 months ago
parent c663c7ae1f
commit 9d16fb5814

@ -1,4 +1,4 @@
FROM node:20-slim AS base FROM node:lts-alpine AS base
ENV PNPM_HOME="/pnpm" ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH" ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable RUN corepack enable

@ -20,18 +20,26 @@ $ pnpm build
Run the following command to bootstrap a **phCD** instance. As this service doesn't have auth for now, it's strongly recommended to publish only on a local ip like `127.0.0.1` and then access directly or via an ssh tunnel (something like `ssh -L 8080:127.0.0.1:8080 server`). Run the following command to bootstrap a **phCD** instance. As this service doesn't have auth for now, it's strongly recommended to publish only on a local ip like `127.0.0.1` and then access directly or via an ssh tunnel (something like `ssh -L 8080:127.0.0.1:8080 server`).
```bash ```bash
# Clone this repo
$ git clone https://git.phc.dm.unipi.it/phc/phcd $ git clone https://git.phc.dm.unipi.it/phc/phcd
$ docker built . -t phcd
$ echo 'deploys: []' > config.yaml # Create config files and data folder
$ mkdir data.local
$ cp .env.sample .env $ cp .env.sample .env
$ echo 'deploys: []' > config.yaml
# Built docker image
$ docker built . -t phcd
# Start container
$ docker run -d \ $ docker run -d \
--name phcd \ --name phcd \
--restart unless-stopped \ --restart unless-stopped \
-p 127.0.0.1:8080:4321 \ -p 127.0.0.1:8080:4321 \
-v ./data.local:./data.local \ -v /var/run/docker.sock:/var/run/docker.sock \
-v ./config.yaml:./config.yaml \ -v ./data.local:/app/data.local \
-v ./.env:/app/.env \
-v ./config.yaml:/app/config.yaml \
phcd phcd
``` ```
@ -39,6 +47,7 @@ $ docker run -d \
```bash ```bash
$ git pull $ git pull
$ docker stop phcd $ docker stop phcd
$ docker built . -t phcd $ docker built . -t phcd
$ docker run -d \ $ docker run -d \
@ -46,6 +55,7 @@ $ docker run -d \
--restart unless-stopped \ --restart unless-stopped \
-p 127.0.0.1:8080:4321 \ -p 127.0.0.1:8080:4321 \
-v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
-v ./data.local:/app/data.local \
-v ./config.yaml:/app/config.yaml \ -v ./config.yaml:/app/config.yaml \
phcd phcd
``` ```

@ -7,7 +7,7 @@
"lint": "astro check", "lint": "astro check",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"start": "node ./dist/server/entry.mjs", "start": "node ./dist/server/entry.mjs"
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.5.6", "@astrojs/check": "^0.5.6",
@ -21,7 +21,6 @@
"dockerode": "^4.0.2", "dockerode": "^4.0.2",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"nodegit": "^0.27.0",
"preact": "^10.19.6", "preact": "^10.19.6",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"zod": "^3.22.4" "zod": "^3.22.4"

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save