Skip to content

Instantly share code, notes, and snippets.

@deliro
Created October 10, 2018 12:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deliro/11df0ccc179095303c72582d72b1e229 to your computer and use it in GitHub Desktop.
Save deliro/11df0ccc179095303c72582d72b1e229 to your computer and use it in GitHub Desktop.
node-to-python multi-stage Vue project build
FROM node:9-alpine AS admin-build
WORKDIR /app
COPY manager .
RUN npm install && npm run build
FROM python:3.7-alpine3.7
EXPOSE 5000
WORKDIR /app
COPY backend backend
COPY crontab crontab
COPY entry.sh entry.sh
COPY entry-cron.sh entry-cron.sh
COPY run_unit_tests.sh run_unit_tests.sh
COPY .git .git
RUN apk add --update --no-cache --virtual .build-deps \
mariadb-dev \
g++ \
libffi-dev && \
apk add --update --no-cache \
tzdata \
git \
mariadb-client-libs && \
ln -fs /usr/share/zoneinfo/Europe/Moscow /etc/localtime && \
mkdir -p /var/logs && \
pip install --no-cache-dir -r ./backend/req.txt && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
cat /app/crontab | crontab -
RUN rm -rf manager && mkdir -p manager/dist/
COPY --from=admin-build /app/dist/ manager/dist
RUN python ./backend/manage.py collectstatic --noinput
CMD ["./entry.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment