Created
October 10, 2018 12:51
-
-
Save deliro/11df0ccc179095303c72582d72b1e229 to your computer and use it in GitHub Desktop.
node-to-python multi-stage Vue project build
This file contains hidden or 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
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