Added frontend build to Docker image
All checks were successful
continuous-integration/drone the build was successful
All checks were successful
continuous-integration/drone the build was successful
This commit is contained in:
parent
d557d45862
commit
f5b443d271
3 changed files with 38 additions and 1 deletions
19
Dockerfile
19
Dockerfile
|
|
@ -1,3 +1,4 @@
|
|||
# Build backend wheels
|
||||
FROM python:3.9 AS builder
|
||||
|
||||
WORKDIR /wheels
|
||||
|
|
@ -7,6 +8,18 @@ COPY ./setup.cfg ./
|
|||
RUN pip wheel -e .
|
||||
|
||||
|
||||
# Build frontend
|
||||
FROM node:16 AS fbuilder
|
||||
|
||||
# Copy source code
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./web ./web
|
||||
COPY Makefile .
|
||||
|
||||
# Build frontend
|
||||
RUN make fbuild
|
||||
|
||||
|
||||
FROM python:3.9-slim
|
||||
|
||||
# Switch to non-root user
|
||||
|
|
@ -30,5 +43,11 @@ WORKDIR /usr/src/app
|
|||
COPY --chown=runner:runner ./app ./app
|
||||
COPY --chown=runner:runner setup.cfg setup.py ./
|
||||
|
||||
# Copy frontend build
|
||||
COPY \
|
||||
--from=fbuilder \
|
||||
--chown=runner:runner \
|
||||
/usr/src/app/web/dist ./dist
|
||||
|
||||
ENTRYPOINT ["python"]
|
||||
CMD ["app"]
|
||||
|
|
|
|||
Reference in a new issue