Change docker-compose.yml to prod settings

New docker-compose.dev.yml can be used as override for development
This commit is contained in:
Paul Voss
2023-02-13 19:45:51 +01:00
parent e22c87584b
commit bfc1e47533
4 changed files with 28 additions and 15 deletions
+1
View File
@@ -1,3 +1,4 @@
node_modules/
config.js
docker-compose.override.yml
*.log
+10 -5
View File
@@ -150,13 +150,18 @@ Wikiless should now be running at <http://localhost:8080>.
### 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).
+12
View File
@@ -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:
+5 -10
View File
@@ -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: