Skip to content

Instantly share code, notes, and snippets.

@SehgalDivij
Created March 2, 2018 18:27
Show Gist options
  • Save SehgalDivij/309bf381b5d0332f2fc263739c791805 to your computer and use it in GitHub Desktop.
Save SehgalDivij/309bf381b5d0332f2fc263739c791805 to your computer and use it in GitHub Desktop.
An ideal way of installing dependencies while building a container Using a Dockerfile. Store dependencies in a file, copy it and then RUN install on that from within the related Dockerfile.
FROM python:2.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /config
ADD /requirements.txt /config/
RUN pip install -r config/requirements.txt;
RUN mkdir /src;
# Create Log Directories
RUN mkdir /logs;
RUN mkdir /logs/rest_api;
# Create Log File Placeholders: dev and prod.
RUN touch /logs/rest_api/dev;
RUN touch /logs/rest_api/prod;
WORKDIR /src
schema==0.6.6
psycopg2==2.7.4
tornado==4.4.2
pyzmq==16.0.2
functools32==3.2.3.post2
momoko==2.2.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment