diff --git a/.gitignore b/.gitignore index 2ee01db..d1e2b89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ config.js +docker-compose.override.yml *.log diff --git a/README.md b/README.md index 72f55c0..2caa0fc 100644 --- a/README.md +++ b/README.md @@ -150,13 +150,18 @@ Wikiless should now be running at . ### Docker & docker compose -You can build a production image by running `docker build .` in the repo's root. - -For development, there's a `docker-compose.yml` that mounts the app code (for hot reload of code changes) and default config. Before running it, you need to install the dependencies: +Run wikiless in production with docker compose: ``` -$ docker-compose run --rm web npm install --no-optionals -$ docker-compose up +$ docker compose up +``` + +For development, there's a `docker-compose.dev.yml` that mounts the app code (for hot reload of code changes) and default config. Before running it, you need to install the dependencies: + +``` +$ cp docker-compose.dev.yml docker-compose.override.yml +$ docker compose run --rm web npm install --no-optionals +$ docker compose up ``` If you are experiencing errors with Redis not connecting, you might want to try the [alternative docker-compose.yml](https://github.com/JarbasAl/wikiless-docker). diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..54c0b0d --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,12 @@ +version: "3.9" +services: + web: + image: node:16-alpine + volumes: + - .:/wikiless + - ./config.js.template:/wikiless/config.js + - node_modules:/wikiless/node_modules + working_dir: /wikiless + command: npm start +volumes: + node_modules: diff --git a/docker-compose.yml b/docker-compose.yml index 89077d0..b2c5fe0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,13 @@ version: "3.9" services: web: - image: node:16-alpine + image: ghcr.io/metastem/wikiless:latest environment: - REDIS_HOST: redis - volumes: - - .:/app - - ./config.js.template:/app/config.js - - node_modules:/app/node_modules - working_dir: /app - command: npm start + # see config.js.template for more settings + DOMAIN: wikiless.example.org + HTTP_ADDR: 0.0.0.0 + REDIS_URL: redis://redis ports: - 8080:8080 redis: image: "redis:alpine" -volumes: - node_modules: