forked from temurchichua/ogb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
47 lines (34 loc) · 1.07 KB
/
Dockerfile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
# pull official base image
FROM nickgryg/alpine-pandas
MAINTAINER Giorgi Kvaratskhelia "[email protected]"
# set work directory
WORKDIR .
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV FLASK_ENV=production \
FLASK_APP=autoapp
ENV GROUP_ID=1000 \
USER_ID=1000
# install dependencies
RUN python -m pip install -U --force-reinstall pip
RUN apk update
RUN apk add --virtual build-deps build-base gcc musl-dev jpeg-dev zlib-dev
RUN apk add postgresql-dev
RUN rm -rf /var/cache/apk/*
# COPY soruce > destination
COPY ./requirements/prod.txt ./requirements/prod.txt
RUN pip install gunicorn
RUN pip install -r ./requirements/prod.txt
# copy project
COPY . .
RUN addgroup -g $GROUP_ID www
RUN adduser -D -u $USER_ID -G www www -s /bin/sh
RUN chown www:www -R /src
RUN chmod +x /src
EXPOSE 5000
USER www
CMD ["gunicorn", "-w", "4", "--bind", "0.0.0.0:5000", "--timeout", "200", "manage"]
# docker build --tag local-app .
# docker run -p 5000:5000 -t -i local-app:latest
#/dedaenabar/static/uploads/profile_pictures > /root/images