Merge pull request 'Add production Dockerfile and development docker-compose.yml' (#3) from mgarciaisaia/Wikiless:feature/docker into main

Reviewed-on: https://codeberg.org/orenom/Wikiless/pulls/3
This commit is contained in:
orenom
2021-05-27 19:12:56 +02:00
3 changed files with 36 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
FROM node:16-alpine
ADD ./ /app
WORKDIR /app
RUN npm install --no-optional
COPY config.js.template config.js
CMD npm start
+11 -1
View File
@@ -21,7 +21,6 @@ Community instances:
## TODO
* Make the mobile version better
* Add docker image, docker-compose
## Why I should use Wikiless instead of Wikipedia?
@@ -131,3 +130,14 @@ If you are like me, and you also like the NSA, feel free to contribute and add m
```
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:
```
$ docker compose run --rm web npm install --no-optionals
$ docker compose up
```
+18
View File
@@ -0,0 +1,18 @@
version: "3.9"
services:
web:
image: node:16-alpine
environment:
REDIS_HOST: redis
volumes:
- .:/app
- ./config.js.template:/app/config.js
- node_modules:/app/node_modules
working_dir: /app
command: npm start
ports:
- 8080:8080
redis:
image: "redis:alpine"
volumes:
node_modules: