Skip to content

Commit

Permalink
Dockerfile cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcooper committed Sep 20, 2024
1 parent 886c6b6 commit 6991896
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
ARG NODE_VERSION=22
FROM "node:${NODE_VERSION}-bookworm-slim" AS node-packages
ARG DEBIAN_VERSION=bookworm


FROM "node:${NODE_VERSION}-${DEBIAN_VERSION}-slim" AS node-packages

COPY tomato/static/admin/tomato/configure_live_clients/package*.json /app/
WORKDIR /app

RUN npm install


FROM python:3.12-bookworm AS final
FROM "python:3.12-${DEBIAN_VERSION}" AS final

ENV DJANGO_SETTINGS_MODULE=tomato.settings \
PYTHONDONTWRITEBYTECODE=1 \
Expand Down
12 changes: 8 additions & 4 deletions server/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM rust:alpine AS minijina-builder
ARG CONTAINER="jonasal/nginx-certbot:5.4-alpine"


FROM "${CONTAINER}" AS minijina-builder

RUN apk add --no-cache cargo

ARG MINIJINJA_VERSION=2.3.1
RUN cargo install \
Expand All @@ -9,8 +14,7 @@ RUN cargo install \
&& strip /build/bin/minijinja-cli


FROM jonasal/nginx-certbot:5.4-alpine AS final
FROM "${CONTAINER}" AS final

COPY --from=minijina-builder /build/bin/minijinja-cli /usr/local/bin/

ADD image/ /
COPY image/ /
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ auto_j2() {
local template_dir="${NGINX_J2_TEMPLATE_DIR:-/etc/nginx/templates}"
local suffix="${NGINX_J2_TEMPLATE_SUFFIX:-.j2}"
local output_dir="${NGINX_J2_OUTPUT_DIR:-/etc/nginx/conf.d}"
local env_file="${NGINX_J2_ENV_FILE:-/.env}"

local template relative_path output_path subdir
[ -d "$template_dir" ] || return 0
Expand Down

0 comments on commit 6991896

Please sign in to comment.