Skip to content

Instantly share code, notes, and snippets.

@diegoquintanav
Created September 21, 2022 19:38
Show Gist options
  • Save diegoquintanav/d86e00eda7c0fdd5d098b7366bbc0656 to your computer and use it in GitHub Desktop.
Save diegoquintanav/d86e00eda7c0fdd5d098b7366bbc0656 to your computer and use it in GitHub Desktop.
docker-compose for lambdalabs machine
version: "3.4"
services:
miniconda:
image: "hfbook-miniconda3:latest"
build:
context: .
dockerfile: Dockerfile
volumes:
- ./notebooks:/src/notebooks
# https://gist.github.com/charlesfrye/e27adfc47129a4c209f6dfcb14467fba
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: [ '0', '1' ]
capabilities: [ gpu ]
from continuumio/miniconda3:latest
RUN mkdir -p /src/notebooks
WORKDIR /src/notebooks
COPY notebooks/environment.yml notebooks/requirements.txt /src/notebooks/
RUN conda env create -f environment.yml
# from https://github.com/nlp-with-transformers/notebooks
COPY notebooks /src/notebooks
# https://pythonspeed.com/articles/activate-conda-dockerfile/
RUN ["conda" ,"run", "--no-capture-output", "-n", "book", "python", "-c", "import sys;print('hello from docker');print(sys.version_info)"]
# https://stackoverflow.com/a/42873832/5819113
ENTRYPOINT ["tail", "-f", "/dev/null"]

$ls -q Dockerfile docker-compose.yml notebooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment