forked from ConservationInternational/trends.earth-API
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 990 Bytes
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:3.9-alpine
USER root
RUN apk update && apk upgrade && \
apk add --no-cache --update bash git openssl-dev build-base alpine-sdk \
libffi-dev postgresql-dev gcc python3-dev musl-dev
RUN apk add --no-cache --update py3-pip
RUN pip install --upgrade pip
RUN pip install virtualenv gunicorn gevent
RUN mkdir -p /opt/misland-api
RUN cd /opt/misland-api && virtualenv venv && source venv/bin/activate
COPY requirements.txt /opt/misland-api/requirements.txt
RUN cd /opt/misland-api && pip install -r requirements.txt
COPY entrypoint.sh /opt/misland-api/entrypoint.sh
COPY main.py /opt/misland-api/main.py
COPY gunicorn.py /opt/misland-api/gunicorn.py
# Copy the application folder inside the container
WORKDIR /opt/misland-api
COPY ./misland_api /opt/misland-api/misland_api
COPY ./migrations /opt/misland-api/migrations
COPY ./tests /opt/misland-api/tests
# Tell Docker we are going to use these ports
EXPOSE 3000
# Launch script
ENTRYPOINT ["sh", "./entrypoint.sh"]