Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gonzalocasas
Created February 20, 2021 11:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gonzalocasas/6202fb57ae39948744d4b36767d6908a to your computer and use it in GitHub Desktop.
Save gonzalocasas/6202fb57ae39948744d4b36767d6908a to your computer and use it in GitHub Desktop.
version: "3.9"
services:
compas_rpc:
build: .
ports:
- "1753:1753"
FROM continuumio/miniconda3 AS build
COPY environment.yml .
RUN conda env create -f environment.yml
RUN conda install -c conda-forge conda-pack
# Use conda-pack to create a standalone enviornment
RUN conda-pack -n compas -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar
RUN /venv/bin/conda-unpack
# Runtime-stage image
FROM debian:buster-slim AS runtime
COPY --from=build /venv /venv
SHELL ["/bin/bash", "-c"]
EXPOSE 1753
ENTRYPOINT source /venv/bin/activate && \
compas_rpc start --no-autoreload
name: compas
channels:
- conda-forge
dependencies:
- python=3.8
- compas=1.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment