Skip to content
Snippets Groups Projects
Commit 107f65da authored by Martin Blanchard's avatar Martin Blanchard
Browse files

Dockerfile: Speed up source (re)builds

parent 756c2a4f
No related branches found
No related tags found
No related merge requests found
# Ignore everything:
*
# Whitelist:
!buildgrid
!data/config
!tests
!LICENSE
!README.rst
!requirements.txt
!requirements.auth.txt
!setup.cfg
!setup.py
!_version.py
!.coveragerc
!.pylintrc
##
# BuildGrid's Docker build manifest.
#
# ¡FOR LOCAL DEVELOPMENT ONLY!
#
# Builds an image from local sources.
#
FROM python:3.5-stretch
# Point the path to where buildgrid gets installed
ENV PATH=$PATH:/root/.local/bin/
# Use /app as working directory:
WORKDIR /app
# Upgrade python modules
RUN python3 -m pip install --upgrade setuptools pip
# Create a virtual environment:
RUN [ \
"python3", "-m", "venv", "/app/env" \
]
# Use /app as the current working directory
WORKDIR /app
# Upgrade Python core modules:
RUN [ \
"/app/env/bin/python", "-m", "pip", \
"install", "--upgrade", \
"setuptools", "pip", "wheel" \
]
# Install the main requirements:
ADD requirements.txt /app
RUN [ \
"/app/env/bin/python", "-m", "pip", \
"install", "--requirement", \
"requirements.txt" \
]
# Install the auth. requirements:
ADD requirements.auth.txt /app
RUN [ \
"/app/env/bin/python", "-m", "pip", \
"install", "--requirement", \
"requirements.auth.txt" \
]
# Copy the repo contents (source, config files, etc) in the WORKDIR
COPY . .
# Copy the repo. contents:
COPY . /app
# Install BuildGrid
RUN pip install --user --editable .
# Install BuildGrid:
RUN [ \
"/app/env/bin/python", "-m", "pip", \
"install", "--editable", \
".[auth,tests]" \
]
# Entry Point of the image (should get an additional argument from CMD, the path to the config file)
ENTRYPOINT ["bgd", "server", "start", "-vv"]
# Entry-point for the image:
ENTRYPOINT [ \
"/app/env/bin/bgd" \
]
# Default config file (used if no CMD specified when running)
CMD ["buildgrid/_app/settings/default.yml"]
# Default command (default config.):
CMD [ \
"server", "start", \
"data/config/default.conf", \
"-vvv" \
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment