diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..c8cfe3959 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/docker/Dockerfile b/docker/Dockerfile index 7f75cef11..f1d77a091 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -# build frontend +# Build frontend FROM node:lts-alpine as front-build-stage WORKDIR /front COPY ./frontend/package*.json . @@ -6,7 +6,7 @@ RUN npm install COPY ./frontend . RUN npm run build -# setup frontend +# Setup frontend FROM ubuntu/nginx:1.18-22.04_edge as production-stage ARG WEBSERVER_FOLDER=/var/www/html COPY --from=front-build-stage /front/dist ${WEBSERVER_FOLDER} @@ -15,7 +15,7 @@ RUN mkdir -p ${WEBSERVER_FOLDER}/assets/romm && \ ln -s /romm/library ${WEBSERVER_FOLDER}/assets/romm/library && \ ln -s /romm/resources ${WEBSERVER_FOLDER}/assets/romm/resources -# setup backend +# Setup backend RUN apt update && \ apt install -y --no-install-recommends ca-certificates curl gnupg && \ # add deadsnakes ppa for Python versions @@ -28,17 +28,18 @@ RUN apt update && \ apt autoremove && \ rm -rf /var/lib/apt/lists/* /var/cache/apt/* WORKDIR /back +COPY ./pyproject.toml ./poetry.lock . RUN pip install --no-cache --upgrade pip && \ pip install --no-cache poetry && \ poetry config virtualenvs.create false && \ - poetry install --no-dev --no-interaction --no-ansi + poetry install --no-interaction --no-ansi --only main COPY ./backend . -# setup init script and config files +# Setup init script and config files COPY ./docker/init_scripts/* / COPY ./docker/nginx/default.conf /etc/nginx/nginx.conf +# Expose ports and start EXPOSE 80 - WORKDIR /romm CMD ["/init"] diff --git a/poetry.lock b/poetry.lock index badefd1bb..bc40f3ccd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -726,5 +726,5 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [metadata] lock-version = "2.0" -python-versions = "^3.11" -content-hash = "c61eb84d70a5d341b1811c9429e2d464f21f4d25d7de5dfd15bf2a7e34dacf55" +python-versions = "^3.10" +content-hash = "75fdf927f51c8897cfc9bce522da9452e7b627c15b90d3fde523c100efd2a666" diff --git a/pyproject.toml b/pyproject.toml index 2bcb643ea..655cd02ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Your Name "] readme = "README.md" [tool.poetry.dependencies] -python = "^3.11" +python = "^3.10" requests = "^2.30.0" fastapi = "^0.95.1" uvicorn = "^0.22.0"