Newer
Older

Jan Maximilian Michal
committed
# Build Python files
FROM python:3.6 as python
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN curl https://gitlab.gwdg.de/snippets/51/raw --output words
# Retrieve noes files
FROM node:latest as node
COPY package.json .
RUN yarn
# Now fetch other files and build on small image
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1

Jan Maximilian Michal
committed
# This set is need otherwise the postgres driver wont work
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \

Jan Maximilian Michal
committed
&& pip install psycopg2 \
&& apk del build-deps

Jan Maximilian Michal
committed
RUN mkdir -p /usr/share/dict
RUN mkdir /code
WORKDIR /code

Jan Maximilian Michal
committed
COPY . /code
COPY --from=python /root/.cache /root/.cache
COPY --from=python /words /usr/share/dict/words
# TODO this won't be necessarry anymore once merged with development
# since the node_modules are served form the Project Root there

Jan Maximilian Michal
committed
COPY --from=node /node_modules core/static/node_modules
RUN pip install -r requirements.txt && rm -rf /root/.cache