Skip to content

Commit

Permalink
Merge pull request #6 from epython-dev/docker-infrastructure
Browse files Browse the repository at this point in the history
[WIP] Docker infrastructure
  • Loading branch information
teoliphant authored Apr 22, 2022
2 parents fa0e7a1 + 0ff6ec9 commit d8c80d6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ epython extmodule.epy --backend=cpython

Produces a compiled extension module for the given Python backend.

## Docker Development
----------------------

Install Docker, then run:

`docker build -t epython-wasm -f ./development/Dockerfile .`

From the root of the repository.

To run the interactive session:

`docker run -p 8008:8000 -t epython-wasm:latest `

# Development

Expand Down
38 changes: 38 additions & 0 deletions development/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM pyodide/pyodide:0.20.0

# Switch shell to bash
SHELL ["/bin/bash", "-c"]

# Setup epyhton-dev
RUN mkdir -p /epython/ &&\
mkdir -p /epython/epython/

# Copy Development Files
COPY ./development/environment.yaml .
COPY ./epython/* /epython/epython/
COPY setup.py /epython/
COPY README.md /epython/
COPY tests /epyhton/

# Add Conda to PATH
ENV PATH /opt/conda/bin:$PATH

# Install Miniconda
RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh" -O ~/miniconda.sh &&\
/bin/bash ~/miniconda.sh -q -b -p /opt/conda &&\
conda init &&\
conda env update --quiet -f ./environment.yaml &&\
echo "conda activate epython-dev" >> /root/.bashrc

ENV PATH /opt/conda/envs/epyhton-dev/bin:$PATH

SHELL ["conda", "run", "-n", "epython-dev", "/bin/bash", "-c"]

RUN cd /epython/ && pip install . &&\
cd /src/pyodide/ && pip install -e pyodide-build

ENV PYTHONPATH /src/pyodide/pyodide-build/:$PYTHONPATH

RUN cd ./pyodide/ && make

CMD ["python", "-m", "pyodide_build", "serve"]
8 changes: 8 additions & 0 deletions development/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: epython-dev
channels:
- conda-forge
dependencies:
- python==3.9
- pydantic
- pip
- pyyaml

0 comments on commit d8c80d6

Please sign in to comment.