mirror of
https://github.com/Metastem/wikiless
synced 2024-12-06 19:16:58 +01:00
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:
@@ -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
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -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:
|
||||
Reference in New Issue
Block a user