mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
last touches to the Dockerfile
This commit is contained in:
parent
b644252b9c
commit
8626b1460a
1 changed files with 10 additions and 5 deletions
15
Dockerfile
15
Dockerfile
|
@ -3,13 +3,15 @@
|
|||
############
|
||||
|
||||
FROM node:lts AS build-ui
|
||||
|
||||
# env setup
|
||||
WORKDIR /usr/local/src/advent22_ui
|
||||
|
||||
# install dependencies
|
||||
# install advent22_ui dependencies
|
||||
COPY ui/package*.json ui/yarn*.lock ./
|
||||
RUN yarn install --production false
|
||||
|
||||
# copy and build full ui
|
||||
# copy and build advent22_ui
|
||||
COPY ui ./
|
||||
RUN yarn build --dest /tmp/advent22_ui/html
|
||||
|
||||
|
@ -18,21 +20,24 @@ RUN yarn build --dest /tmp/advent22_ui/html
|
|||
###########
|
||||
|
||||
FROM tiangolo/uvicorn-gunicorn:python3.11-slim AS production
|
||||
WORKDIR /usr/local/src/advent22_api
|
||||
|
||||
# env setup
|
||||
WORKDIR /usr/local/src/advent22_api
|
||||
ENV \
|
||||
PRODUCTION_MODE="true" \
|
||||
PORT="8000" \
|
||||
MODULE_NAME="advent22_api.app"
|
||||
EXPOSE 8000
|
||||
|
||||
# install api
|
||||
# install advent22_api
|
||||
COPY api ./
|
||||
RUN set -ex; \
|
||||
# remove example app
|
||||
rm -rf /app; \
|
||||
\
|
||||
python -m pip --no-cache-dir install ./
|
||||
|
||||
# add prebuilt ui
|
||||
# add prepared advent22_ui
|
||||
COPY --from=build-ui /tmp/advent22_ui /usr/local/share/advent22_ui
|
||||
|
||||
# run as unprivileged user
|
||||
|
|
Loading…
Reference in a new issue