update "local" docker settings, use js/css from cdn

(remove unnecessary "linode" docker setup)
ignore fonts
This commit is contained in:
2022-11-14 18:30:00 -05:00
parent d07dd3208d
commit 9a18bb56ab
67 changed files with 88 additions and 88386 deletions

View File

@@ -6,23 +6,28 @@ FROM python:${PYTHON_VERSION} as python
# Python build stage
FROM python as python-build-stage
ARG BUILD_ENVIRONMENT=local
ARG BUILD_ENVIRONMENT=linode
# Install apt packages
RUN apt-get update && apt-get install --no-install-recommends -y \
# dependencies for building Python packages
build-essential \
# psycopg2 dependencies
libpq-dev
libpq-dev \
# git
git \
# ssh
openssh-client
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan home.ascorrea.com >> ~/.ssh/known_hosts
# Requirements are installed here to ensure they will be cached.
COPY ./requirements .
COPY ./requirements/ .
# Create Python Dependency and Sub-Dependency Wheels.
RUN pip wheel --wheel-dir /usr/src/app/wheels \
RUN --mount=type=ssh,id=git_ssh_key pip wheel --wheel-dir /usr/src/app/wheels \
-r ${BUILD_ENVIRONMENT}.txt
# Python 'run' stage
FROM python as python-run-stage
@@ -41,23 +46,29 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libpq-dev \
# Translations dependencies
gettext \
# cleaning up unused files
# ssh
openssh-client \
#git
git \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan home.ascorrea.com >> ~/.ssh/known_hosts
# All absolute dir copies ignore workdir instruction. All relative dir copies are wrt to the workdir instruction
# copy python dependency wheels from python-build-stage
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
# use wheels to install python dependencies
RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \
RUN --mount=type=ssh,id=git_ssh_key pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \
&& rm -rf /wheels/
COPY ./compose/production/django/entrypoint /entrypoint
RUN sed -i 's/\r$//g' /entrypoint
RUN chmod +x /entrypoint
COPY ./compose/local/django/start /start
COPY ./compose/linode/django/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start

View File

@@ -14,15 +14,19 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
# psycopg2 dependencies
libpq-dev \
# cleaning up unused files
git \
openssh-client \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
# Requirements are installed here to ensure they will be cached.
COPY ./requirements /requirements
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan home.ascorrea.com >> ~/.ssh/known_hosts
# create python dependency wheels
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels \
RUN --mount=type=ssh,id=git_ssh_key pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels \
-r /requirements/local.txt -r /requirements/production.txt \
&& rm -rf /requirements