Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support added #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3.9-bullseye

ARG userUID=1000

RUN DEBIAN_FRONTEND=noninteractive apt update && apt install nodejs npm -y

RUN npm install -g n && n stable && n 16.10.0
RUN npm install -g @angular/[email protected]

RUN useradd -m -u $userUID user
USER user

WORKDIR /home/user

RUN mkdir enigma

RUN mkdir -p enigma/frontend/node_modules

COPY /backend/requirements.txt /home/user/enigma/backend/requirements.txt
COPY /frontend/package.json /home/user/enigma/frontend/package.json

RUN pip install -r ~/enigma/backend/requirements.txt && pip install tinyec

RUN export FLASK_APP=colossus
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,20 @@ ng serve

Now you can go to `http://localhost:4200` and test the app.

## Docker
You can easily run the project using the provided Dockerfile.

Run:

```bash
# /path/to/enigma
docker build -t enigma .
docker run -it -v /path/to/enigma:/home/user/enigma -p 4200:4200 -p 5000:5000 enigma /bin/bash
user@dockerid:~$ cd enigma/backend python3 -m flask run -h 0.0.0.0
user@dockerid:~$ cd ../frontend && npm install && ng serve --host 0.0.0.0
```

Now you can go to `http://localhost:4200` and test the app.

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
Expand Down