Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample dockerfile for a project that uses spacy
FROM python:3
RUN apt-get update
RUN pip3 install \
spacy \
...
RUN python3 -m spacy download en
COPY . /app
# https://stackoverflow.com/a/39855387/1068511
RUN useradd -ms /bin/bash myapp
USER myapp
WORKDIR /app
# project folder structure
# root
# |---- __init__.py
# |---- scripts
# | |- __init__.py
# | |- training.py
# |
# |---- model
# |- < Generated model >
# build the docker image
# $ docker build -t myspacy .
# run the training script
# $ docker run -v $(pwd)/model:/app/model myspacy python -m scripts.training -o model/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.