Skip to content

Commit e2505c9

Browse files
authored
Jfrazier/docker (#52)
* add docker file * update docs to reflect using docker
1 parent d46f2d9 commit e2505c9

5 files changed

Lines changed: 66 additions & 1 deletion

File tree

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.venv
2+
.venv_lingua_loop
3+
__pycache__/
4+
*.pyc
5+
*.pyo
6+
*.egg-info
7+
.git
8+
.gitignore
9+
.github
10+
.hypothesis
11+
.pytest_cache
12+
docs/
13+
node_modules/
14+
tests/
15+
*.db
16+
.env
17+
.envrc
18+
uv.lock
19+
README.md

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.12-slim
2+
3+
RUN pip install uv
4+
5+
WORKDIR /app
6+
7+
COPY pyproject.toml .
8+
COPY src/ src/
9+
10+
RUN uv sync --no-default-groups
11+
12+
EXPOSE 49152
13+
14+
ENV PATH="/app/.venv/bin:$PATH"
15+
CMD ["lingua-loop"]

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,24 @@ python -m venv .venv_lingua_loop
243243
uv pip install git+https://github.com/jfdev001/lingua-loop.git
244244
```
245245

246+
### Docker
247+
248+
You can also run `lingua-loop` with Docker. Build the image:
249+
250+
```
251+
git clone --depth 1 https://github.com/jfdev001/lingua-loop.git
252+
cd lingua-loop
253+
docker build -t lingua-loop .
254+
```
255+
256+
Then run the container:
257+
258+
```
259+
docker run -p 49152:49152 lingua-loop
260+
```
261+
262+
> **Note:** The browser auto-open feature does not work inside a container. Manually open http://localhost:49152 in your browser.
263+
246264
# References
247265

248266
Below are a series of references, in no particular order, that I used to gain

docs/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ For a faster install using the ``uv`` package manager:
5252
5353
uv pip install git+https://github.com/jfdev001/lingua-loop.git
5454
55+
Using Docker:
56+
57+
.. code-block:: bash
58+
59+
git clone --depth 1 https://github.com/jfdev001/lingua-loop.git
60+
cd lingua-loop
61+
docker build -t lingua-loop .
62+
docker run -p 49152:49152 lingua-loop
63+
64+
.. important::
65+
The browser auto-open feature does not work inside a container.
66+
Manually open http://localhost:49152 in your browser.
67+
5568
.. note::
5669
This package is under active development and updated frequently.
5770

src/lingua_loop/scripts/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def run():
2222
print(f"Making {DATABASE_DIR}")
2323
mkdir(DATABASE_DIR)
2424

25-
host = "127.0.0.1"
25+
host = "0.0.0.0"
2626
free_port = 49152
2727
threading.Timer(
2828
2.0, lambda: webbrowser.open(f"http://{host}:{free_port}")

0 commit comments

Comments
 (0)