diff --git a/Dockerfile b/Dockerfile index c9f481b..cf39c0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,11 @@ FROM node:lts AS build-ui WORKDIR /usr/local/src/advent22_ui # install dependencies -COPY ui/package*.json ui/yarn*.lock . +COPY ui/package*.json ui/yarn*.lock ./ RUN yarn install --production false # copy and build full ui -COPY ui . +COPY ui ./ RUN yarn build --dest /tmp/advent22_ui/html ########### @@ -23,12 +23,17 @@ WORKDIR /usr/local/src/advent22_api # env setup ENV \ PRODUCTION_MODE="true" \ - APP_MODULE="advent22_api.app:app" + MODULE_NAME="advent22_api.app" # install api -COPY api . -RUN python -m pip --no-cache-dir install . +COPY api ./ +RUN set -ex; \ + rm -rf /app; \ + \ + python -m pip --no-cache-dir install ./ # add prebuilt ui COPY --from=build-ui /tmp/advent22_ui /usr/local/share/advent22_ui +# run as unprivileged user +USER nobody