Skip to content
Snippets Groups Projects
Dockerfile 993 B
Newer Older
  • Learn to ignore specific revisions
  • # 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
    
    
    # This set is need otherwise the postgres driver wont work
    RUN apk update \
      && apk add --virtual build-deps gcc python3-dev musl-dev \
    
    robinwilliam.hundt's avatar
    robinwilliam.hundt committed
      && apk add --no-cache postgresql-dev \
    
    RUN mkdir /code
    WORKDIR /code
    
    COPY . /code
    COPY --from=python /root/.cache /root/.cache
    COPY --from=python /words /usr/share/dict/words
    
    robinwilliam.hundt's avatar
    robinwilliam.hundt committed
    # TODO this won't be necessarry anymore once merged with development
    # since the node_modules are served form the Project Root there
    
    COPY --from=node   /node_modules core/static/node_modules
    
    RUN pip install -r requirements.txt && rm -rf /root/.cache