Dockerfile 1007 Bytes
Newer Older
1
2
FROM ubuntu:18.04
LABEL MAINTAINER Luís de Sousa <luis.desousa@wur.nl>
3

4
5
RUN apt update && apt -y install python-pip python-dev nginx curl
RUN mkdir -p /var/www/wsm.rest
6

7
8
9
10
11
12
13
14
WORKDIR /var/www/wsm.rest

COPY . .

RUN chmod +x configs/startup.sh
RUN pip install -r requirements.txt

ENTRYPOINT [ "configs/startup.sh" ]
15

16
EXPOSE 80
17
STOPSIGNAL SIGQUIT
18

19
20
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1
CMD ["nginx", "-g", "daemon off;"]
21
22
################### Usage #####################

23
24
25
# Build it
# docker build -t ldesousa/wsm.rest .

26
# Set the correct database connection in using environment variables or an env-file:
27

28
29
# Run command with envfile
# docker run -dit --env-file /path/to/envfile -v /data/monoliths:/data/monoliths --name wsm.rest -p 8081:80 ldesousa/wsm.rest
30

31
32
# Declaring variables inline:
# 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