diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2dbacaf --- /dev/null +++ b/Dockerfile @@ -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/cli@14.2.10 + +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 diff --git a/README.md b/README.md index f4a5d5b..c8e1a8d 100644 --- a/README.md +++ b/README.md @@ -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.