Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak a few Dockerfile commands #148

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Added `CSRF_COOKIE_SECURE = not DEBUG` setting to template.
- Added `AWS_S3_CUSTOM_DOMAIN` setting to template.

### Changed

- Tweaked a few of the commands in the template's `Dockerfile` to consolidate the ones that could be.

### Fixed

- Fixed a bug with the `ssl_require` argument in the database config in `settings.py`. When building or testing, we sometimes fall back to just using SQLite to avoid having to spin up a Postgres database. However, SQLite doesn't know what to do with the `sql_require` argument, so we disable it for SQLite.
Expand Down
9 changes: 4 additions & 5 deletions src/django_twc_project/Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ RUN case ${BUILDARCH} in \

FROM base as app
COPY --from=py --link /usr/local /usr/local
COPY --link manage.py /app
COPY --link package.json /app
COPY --link manage.py package.json /app
COPY --link {{ module_name }} /app/{{ module_name }}
COPY --link templates /app/templates

Expand All @@ -118,9 +117,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,t


FROM node as node-final
ENV DATABASE_URL sqlite://:memory:
COPY --from=tailwind --link /usr/local /usr/local
COPY --from=app --link /app /app
COPY --link static /app/static
COPY --link static/src /app/static/src
{%- if include_vite %}
COPY --link postcss.config.mjs tailwind.config.mjs tsconfig.json vite.config.ts /app/
RUN npm run build \
Expand All @@ -146,8 +146,7 @@ ARG GID
COPY --from=py --link /usr/local /usr/local
COPY --from=app --chown=${UID}:${GID} --link /app /app
COPY --from=static --chown=${UID}:${GID} --link /app/staticfiles /app/staticfiles
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /usr/local/bin/tailscaled
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscale /usr/local/bin/tailscale
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /usr/local/bin/tailscale /usr/local/bin/
COPY --chmod=755 --link .bin /
RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale \
&& apt-get remove -y --purge \
Expand Down