Commit f58cfdbd authored by Buskermolen, Joost's avatar Buskermolen, Joost
Browse files

fix: Optimise Dockerfile + extend readme

parent e426752b
FROM ubuntu:18.04
LABEL MAINTAINER Luís de Sousa <luis.desousa@wur.nl>
RUN apt update && apt -y install python-pip python-dev nginx curl
RUN apt update && apt -y install python-pip python-dev nginx curl && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/www/wsm.rest
WORKDIR /var/www/wsm.rest
......
......@@ -102,23 +102,19 @@ To build the container image change to the project folder and run:
`docker build -t ldesousa/wsm.rest .`
The resulting image is named `ldesousa/wsm.rest`. To run the image it is
necessary to map the source code folder and port 80 (where nginx listens):
The resulting image is named `ldesousa/wsm.rest`.
To run the image it is necessary to map the right environment variables to connect to the database as well as mount the source code folder and bind port 80 (where nginx listens):
`docker run -dit -v /var/www/wsm.rest:/var/www/wsm.rest --name wsm.rest -p 8081:80 ldesousa/wsm.rest`
Gunicorn can only be started after the source code folder has been mapped. To
do so attach to the running container (named `wsm.rest`):
`docker attach wsm.rest`
And then run the startup script:
`sh /var/www/wsm.rest/configs/startup.sh`
Finally, detach orderly from the running container with the escape sequence:
Docker run command with envfile:
```bash
docker run -dit --env-file /path/to/envfile -v /data/monoliths:/data/monoliths --name wsm.rest -p 8081:80 ldesousa/wsm.rest
```
Docker run command with variables inline:
```bash
docker run -dit -e DB_HOST=scomp1270.wurnet.nl -e DB_NAME=isric -e DB_USER=haas005 -e DB_PASSWORD=wur -e DB_PORT=5479 -v /data/monoliths:/data/monoliths --name wsm.rest -p 8081:80 ldesousa/wsm.rest
```
`Ctrl+P Ctrl+Q`
Your container will now be available on [localhost:8081](http://localhost:8081)
OC deployment
=============
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment