forked from Kegbot/kegbot-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (45 loc) · 1.15 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
48
49
50
51
52
53
54
FROM python:3-alpine
RUN mkdir /app
WORKDIR /app
ENV SHELL=/bin/sh \
PIP_NO_CACHE_DIR=1 \
KEGBOT_DATA_DIR=/kegbot-data \
KEGBOT_IN_DOCKER=True \
KEGBOT_ENV=debug
RUN apk update && \
apk add --no-cache \
bash \
curl \
libjpeg \
libjpeg-turbo \
openjpeg \
mariadb-connector-c-dev \
libpq && \
apk add --no-cache --virtual _build-deps \
build-base \
mariadb-dev \
postgresql-dev \
libjpeg-turbo-dev \
zlib-dev \
py-gevent \
libffi-dev
RUN pip install poetry
COPY pyproject.toml poetry.lock ./
ADD pykeg/__init__.py ./pykeg/
RUN poetry config virtualenvs.create false && poetry install -n
ADD bin ./bin
ADD pykeg ./pykeg
RUN poetry run python bin/kegbot collectstatic --noinput -v 0
ARG GIT_SHORT_SHA="unknown"
ARG VERSION="unknown"
ARG BUILD_DATE="unknown"
RUN echo "GIT_SHORT_SHA=${GIT_SHORT_SHA}" > /etc/kegbot-version
RUN echo "VERSION=${VERSION}" >> /etc/kegbot-version
RUN echo "BUILD_DATE=${BUILD_DATE}" >> /etc/kegbot-version
VOLUME ["/kegbot-data"]
EXPOSE 8000
CMD [ \
"gunicorn", \
"pykeg.web.wsgi:application", \
"--config=python:pykeg.web.gunicorn_conf" \
]