Skip to content

Commit 77547b1

Browse files
Set up docker environment and improve spider plot rendering
1 parent e406f4d commit 77547b1

12 files changed

Lines changed: 7797 additions & 1264 deletions

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ dist
55
.DS_Store
66
npm-debug.log*
77
coverage
8+
.venv
9+
__pycache__
10+
.pytest_cache
11+
data
12+
milestone1
13+
milestone2
14+
scripts
15+
Milestone 3.pdf
16+
README.md
17+
NOTES.md
18+
dataset-sources.md

Dockerfile.python

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM python:3.12-slim
2+
3+
WORKDIR /workspace
4+
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONUNBUFFERED=1
7+
ENV PIP_NO_CACHE_DIR=1
8+
9+
RUN useradd --create-home --shell /bin/bash appuser
10+
11+
COPY requirements.txt ./
12+
RUN pip install --upgrade pip && pip install -r requirements.txt
13+
14+
RUN chown -R appuser:appuser /workspace /home/appuser
15+
USER appuser
16+
17+
EXPOSE 8888
18+
19+
CMD ["jupyter", "lab", "--ip", "0.0.0.0", "--port", "8888", "--no-browser", "--IdentityProvider.token="]

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@
1010

1111
[Webpage (WIP)](https://com-480-data-visualization.github.io/special-operations/)
1212

13+
## Docker setup
14+
15+
Use Docker Compose to run both the frontend and the Python project environment:
16+
17+
```bash
18+
docker compose up --build
19+
```
20+
21+
Services:
22+
23+
- `web`: Vite dev server on `http://localhost:5173`
24+
- `notebook`: JupyterLab on `http://localhost:8888`
25+
26+
Useful commands:
27+
28+
```bash
29+
# Start only the frontend
30+
docker compose up --build web
31+
32+
# Start only JupyterLab / Python environment
33+
docker compose up --build notebook
34+
35+
# Run the preprocessing script inside Docker
36+
docker compose run --rm notebook python milestone2/preprocess.py
37+
38+
# Rebuild treemap data inside Docker
39+
docker compose run --rm notebook python scripts/build_treemap_data.py
40+
```
41+
1342
## Milestone 1 (20th March, 5pm)
1443

1544
**10% of the final grade**
@@ -58,4 +87,3 @@ Please, fill the following sections about your project.
5887

5988
- < 24h: 80% of the grade for the milestone
6089
- < 48h: 70% of the grade for the milestone
61-

docker-compose.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
# Runs the local Vite development server in Docker while keeping dependencies
2-
# inside an isolated container volume.
1+
# Runs the frontend dev server and a separate Python/Jupyter workspace in Docker
2+
# so the project can be developed without installing Node or Python locally.
33
services:
44
web:
55
build:
66
context: .
7-
command: sh -c "npm install --no-audit --no-fund && npm run dev -- --host 0.0.0.0"
7+
dockerfile: Dockerfile
8+
command: npm run dev -- --host 0.0.0.0
89
user: node
910
ports:
1011
- "5173:5173"
1112
volumes:
1213
- .:/app
1314
- node_modules:/app/node_modules
1415

16+
notebook:
17+
build:
18+
context: .
19+
dockerfile: Dockerfile.python
20+
command: jupyter lab --ip 0.0.0.0 --port 8888 --no-browser --IdentityProvider.token=
21+
ports:
22+
- "8888:8888"
23+
volumes:
24+
- .:/workspace
25+
- pip_cache:/home/appuser/.cache/pip
26+
1527
volumes:
1628
node_modules:
29+
pip_cache:

0 commit comments

Comments
 (0)