-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Web: Abandon CRA, use Vite for building web app and provide new glue …
…for plugins (#741)
- Loading branch information
Showing
155 changed files
with
5,890 additions
and
29,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
FROM python:3.8-alpine AS build | ||
|
||
WORKDIR /app | ||
RUN python3 -m venv /app/venv | ||
RUN /app/venv/bin/pip --no-cache-dir install wheel | ||
|
||
RUN apk add --no-cache libffi libffi-dev py3-cffi build-base python3-dev automake m4 autoconf libtool gcc g++ musl-dev openssl-dev cargo postgresql-dev | ||
|
||
COPY requirements.txt /app | ||
RUN /app/venv/bin/pip --no-cache-dir install -r /app/requirements.txt | ||
|
||
COPY docker/plugins /app/plugins | ||
ARG plugins | ||
RUN for plugin in $plugins $(find /app/plugins -name 'setup.py' -exec dirname {} \; | sort -u); \ | ||
do /app/venv/bin/pip --no-cache-dir install $plugin; done | ||
|
||
FROM python:3.8-alpine | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
RUN apk add --no-cache postgresql-client postgresql-dev libmagic | ||
|
||
COPY requirements.txt docker/plugins/requirements-*.txt /tmp/ | ||
RUN apk add --no-cache -t build libffi libffi-dev py3-cffi build-base python3-dev automake m4 autoconf libtool gcc g++ musl-dev openssl-dev cargo \ | ||
&& pip --no-cache-dir install -r /tmp/requirements.txt \ | ||
&& ls /tmp/requirements-*.txt | xargs -i,, pip --no-cache-dir install -r ,, \ | ||
&& apk del build | ||
|
||
# Copy backend files | ||
COPY --from=build /app/venv /app/venv | ||
COPY docker/ setup.py MANIFEST.in requirements.txt /app/ | ||
COPY mwdb /app/mwdb/ | ||
|
||
# Install mwdb-core package | ||
RUN pip install /app | ||
RUN /app/venv/bin/pip install /app | ||
|
||
# Create a /app/uploads directory | ||
# Give +r to everything in /app and +x for directories | ||
|
@@ -28,7 +39,6 @@ RUN mkdir -p /app/uploads/ && \ | |
|
||
ENV PYTHONPATH=/app | ||
ENV FLASK_APP=/app/mwdb/app.py | ||
# How many workers gunicorn should spawn by default | ||
WORKDIR /app | ||
|
||
CMD ["/app/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
FROM node:14 AS build | ||
FROM node:16-alpine AS build | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
COPY ./mwdb/web /app | ||
COPY ./docker/plugins /plugins | ||
COPY ./docker/plugins /app/plugins | ||
|
||
ARG web_plugins | ||
RUN cd /app \ | ||
&& npm install --unsafe-perm . $(find /plugins -name 'package.json' -printf "%h\n" | sort -u) \ | ||
&& npm install --unsafe-perm . $web_plugins $(find /app/plugins -name 'package.json' -exec dirname {} \; | sort -u) \ | ||
&& CI=true npm run build \ | ||
&& npm cache clean --force | ||
|
||
FROM nginx:stable | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
ENV PROXY_BACKEND_URL http://mwdb.:8080 | ||
|
||
COPY docker/nginx.conf.template /etc/nginx/conf.d/default.conf.template | ||
COPY docker/start-web.sh /start-web.sh | ||
COPY --from=build /app/build /usr/share/nginx/html | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
# Give +r to everything in /usr/share/nginx/html and +x for directories | ||
RUN chmod u=rX,go= -R /usr/share/nginx/html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
FROM node:14 AS build | ||
FROM node:16-alpine AS build | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
COPY ./mwdb/web /app | ||
COPY ./docker/plugins /plugins | ||
COPY ./docker/plugins /app/plugins | ||
|
||
ARG web_plugins | ||
RUN cd /app \ | ||
&& npm install --unsafe-perm . $(find /plugins -name 'package.json' -printf "%h\n" | sort -u) \ | ||
&& npm install --unsafe-perm . $web_plugins $(find /app/plugins -name 'package.json' -exec dirname {} \; | sort -u) \ | ||
&& CI=true npm run build \ | ||
&& npm cache clean --force | ||
|
||
ENV PROXY_BACKEND_URL http://mwdb.:8080 | ||
|
||
WORKDIR /app | ||
CMD ["npm", "run", "start"] | ||
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.