docker: Use a .env file

This commit is contained in:
noirscape 2020-04-06 21:43:12 +02:00
parent 4e961192d4
commit d2da8d0b9a
No known key found for this signature in database
GPG Key ID: 38216818B8894B9F
4 changed files with 18 additions and 8 deletions

2
.gitignore vendored
View File

@ -7,4 +7,4 @@ node_modules
yarn.lock yarn.lock
dist dist
mango mango
docker-compose.yml .env

View File

@ -28,10 +28,10 @@ Simply download the pre-built binary file `mango` for the latest [release](https
1. Make sure you have docker installed and running. You will also need `docker-compose` 1. Make sure you have docker installed and running. You will also need `docker-compose`
2. Clone the repository 2. Clone the repository
3. Copy `docker-compose.example.yml` to `docker-compose.yml` 3. Copy the `env.example` file to `.env`
4. Modify the `volumes` in `docker-compose.yml` to point the directories to desired locations on the host machine 4. Fill out the values in the `.env` file. Note that the main and config directories will be created if they don't already exist. The files in these folders will be owned by the root user
5. Run `docker-compose up`. This should build the docker image and start the container with Mango running inside 5. Run `docker-compose up`. This should build the docker image and start the container with Mango running inside
6. Head over to `localhost:9000` to log in 6. Head over to `localhost:9000` (or a different port if you changed it) to log in
### Docker (via Dockerhub) ### Docker (via Dockerhub)

View File

@ -7,9 +7,9 @@ services:
context: . context: .
dockerfile: ./Dockerfile dockerfile: ./Dockerfile
expose: expose:
- 9000 - ${PORT}
ports: ports:
- 9000:9000 - "${PORT}:9000"
volumes: volumes:
- ~/mango:/root/mango - ${MAIN_DIRECTORY_PATH}:/root/mango
- ~/.config/mango:/root/.config/mango - ${CONFIG_DIRECTORY_PATH}:/root/.config/mango

10
env.example Normal file
View File

@ -0,0 +1,10 @@
# Port that exposes the HTTP frontend
PORT=9000
# Path to the mango main directory
# This directory holds the database and the library files
MAIN_DIRECTORY_PATH=
# Path to the mango config directory
# This directory holds the mango configuration path
CONFIG_DIRECTORY_PATH=