Skip to content

Commit d8c80d6

Browse files
authored
Merge pull request #6 from epython-dev/docker-infrastructure
[WIP] Docker infrastructure
2 parents fa0e7a1 + 0ff6ec9 commit d8c80d6

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ epython extmodule.epy --backend=cpython
2626

2727
Produces a compiled extension module for the given Python backend.
2828

29+
## Docker Development
30+
----------------------
31+
32+
Install Docker, then run:
33+
34+
`docker build -t epython-wasm -f ./development/Dockerfile .`
35+
36+
From the root of the repository.
37+
38+
To run the interactive session:
39+
40+
`docker run -p 8008:8000 -t epython-wasm:latest `
2941

3042
# Development
3143

development/Dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM pyodide/pyodide:0.20.0
2+
3+
# Switch shell to bash
4+
SHELL ["/bin/bash", "-c"]
5+
6+
# Setup epyhton-dev
7+
RUN mkdir -p /epython/ &&\
8+
mkdir -p /epython/epython/
9+
10+
# Copy Development Files
11+
COPY ./development/environment.yaml .
12+
COPY ./epython/* /epython/epython/
13+
COPY setup.py /epython/
14+
COPY README.md /epython/
15+
COPY tests /epyhton/
16+
17+
# Add Conda to PATH
18+
ENV PATH /opt/conda/bin:$PATH
19+
20+
# Install Miniconda
21+
RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh" -O ~/miniconda.sh &&\
22+
/bin/bash ~/miniconda.sh -q -b -p /opt/conda &&\
23+
conda init &&\
24+
conda env update --quiet -f ./environment.yaml &&\
25+
echo "conda activate epython-dev" >> /root/.bashrc
26+
27+
ENV PATH /opt/conda/envs/epyhton-dev/bin:$PATH
28+
29+
SHELL ["conda", "run", "-n", "epython-dev", "/bin/bash", "-c"]
30+
31+
RUN cd /epython/ && pip install . &&\
32+
cd /src/pyodide/ && pip install -e pyodide-build
33+
34+
ENV PYTHONPATH /src/pyodide/pyodide-build/:$PYTHONPATH
35+
36+
RUN cd ./pyodide/ && make
37+
38+
CMD ["python", "-m", "pyodide_build", "serve"]

development/environment.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: epython-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python==3.9
6+
- pydantic
7+
- pip
8+
- pyyaml

0 commit comments

Comments
 (0)