diff --git a/Dockerfile-dev b/Dockerfile-dev index 17834a6f..736cd192 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -1,18 +1,20 @@ -FROM node:lts as build +FROM node:lts AS build WORKDIR /code COPY . /code +RUN apt-get update && apt-get install -y chromium RUN make install-deps-typescript && make install-typescript && make frontend -FROM python:3.11.0 as run +FROM python:3.11.0 AS run COPY --from=build /code /code WORKDIR /code RUN apt update &&\ apt install -y python3-numpy &&\ pip install virtualenv &&\ + python3 -m venv venv && \ make install-deps-python &&\ make install-python -ENTRYPOINT make dev-flask +ENTRYPOINT make dev-flask-docker diff --git a/Makefile b/Makefile index e1da38cd..5d53f1db 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,9 @@ upstream-sync: dev-flask: . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run +dev-flask-docker: + . ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run --host=0.0.0.0 + e2e: yarn build [ -d "./venv" ] && . ./venv/bin/activate &&\ @@ -83,7 +86,7 @@ docker-prod: docker build -f Dockerfile -t opencre:$(shell git rev-parse HEAD) . docker-dev-run: - docker run -it -p 5000:5000 opencre-dev:$(shell git rev-parse HEAD) + docker run -it -p 127.0.0.1:5000:5000 opencre-dev:$(shell git rev-parse HEAD) docker-prod-run: docker run -it -p 5000:5000 opencre:$(shell git rev-parse HEAD)