Files
tabby-web/Dockerfile

67 lines
2.1 KiB
Docker
Raw Permalink Normal View History

2021-11-21 00:08:04 +01:00
# syntax=docker/dockerfile:1
FROM node:12-alpine AS frontend-build
WORKDIR /app
COPY frontend/package.json frontend/yarn.lock ./
2022-01-26 20:02:00 +01:00
RUN yarn install --frozen-lockfile --network-timeout 1000000
2021-11-21 00:08:04 +01:00
COPY frontend/webpack* frontend/tsconfig.json ./
COPY frontend/assets assets
COPY frontend/src src
COPY frontend/theme theme
RUN yarn run build
RUN yarn run build:server
FROM node:12-alpine AS frontend
WORKDIR /app
COPY --from=frontend-build /app/build build
COPY --from=frontend-build /app/build-server build-server
COPY frontend/package.json .
CMD ["npm", "start"]
# ----
FROM python:3.7-alpine AS build-backend
ARG EXTRA_DEPS
RUN apk add build-base musl-dev libffi-dev openssl-dev mariadb-dev
WORKDIR /app
RUN pip install -U setuptools 'cryptography>=3.0,<3.1' poetry==1.1.7
COPY backend/pyproject.toml backend/poetry.lock ./
RUN poetry config virtualenvs.path /venv
RUN poetry install --no-dev --no-ansi --no-interaction
2022-09-22 16:39:48 +05:30
RUN poetry run pip install -U setuptools psycopg2-binary $EXTRA_DEPS
2021-11-21 00:08:04 +01:00
COPY backend/manage.py backend/gunicorn.conf.py ./
COPY backend/tabby tabby
COPY --from=frontend /app/build /frontend
2022-11-07 18:58:41 +01:00
ARG BUNDLED_TABBY=1.0.187-nightly.1
2021-11-21 00:08:04 +01:00
RUN FRONTEND_BUILD_DIR=/frontend /venv/*/bin/python ./manage.py collectstatic --noinput
RUN APP_DIST_STORAGE=file:///app-dist /venv/*/bin/python ./manage.py add_version ${BUNDLED_TABBY}
2021-11-21 00:08:04 +01:00
FROM python:3.7-alpine AS backend
ENV APP_DIST_STORAGE file:///app-dist
ENV DOCKERIZE_VERSION v0.6.1
2022-01-27 11:40:30 +01:00
ENV DOCKERIZE_ARCH amd64
ARG TARGETPLATFORM
2022-01-27 11:40:30 +01:00
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; \
then export DOCKERIZE_ARCH=armhf; \
else export DOCKERIZE_ARCH=amd64; \
fi
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-$DOCKERIZE_ARCH-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-$DOCKERIZE_ARCH-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-$DOCKERIZE_ARCH-$DOCKERIZE_VERSION.tar.gz
2021-11-21 00:08:04 +01:00
RUN apk add mariadb-connector-c
COPY --from=build-backend /app /app
COPY --from=build-backend /app-dist /app-dist
2021-11-21 00:08:04 +01:00
COPY --from=build-backend /venv /venv
COPY backend/start.sh backend/manage.sh /
RUN chmod +x /start.sh /manage.sh
CMD ["/start.sh"]