mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-16 01:44:51 +03:00
Pass variables required by Webpack at build time
This commit is contained in:
parent
41af10eff4
commit
c7e128a6d4
|
@ -9,6 +9,17 @@ WORKDIR ${APP_HOME}
|
||||||
COPY ./package.json ${APP_HOME}
|
COPY ./package.json ${APP_HOME}
|
||||||
RUN npm install && npm cache clean --force
|
RUN npm install && npm cache clean --force
|
||||||
COPY . ${APP_HOME}
|
COPY . ${APP_HOME}
|
||||||
|
{%- if cookiecutter.use_whitenoise == 'n' %}
|
||||||
|
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
||||||
|
ARG DJANGO_AWS_STORAGE_BUCKET_NAME
|
||||||
|
ENV DJANGO_AWS_STORAGE_BUCKET_NAME=${DJANGO_AWS_STORAGE_BUCKET_NAME}
|
||||||
|
ARG DJANGO_AWS_S3_CUSTOM_DOMAIN
|
||||||
|
ENV DJANGO_AWS_S3_CUSTOM_DOMAIN=${DJANGO_AWS_S3_CUSTOM_DOMAIN}
|
||||||
|
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
||||||
|
ARG DJANGO_GCP_STORAGE_BUCKET_NAME
|
||||||
|
ENV DJANGO_GCP_STORAGE_BUCKET_NAME=${DJANGO_GCP_STORAGE_BUCKET_NAME}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -10,6 +10,17 @@ services:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./compose/production/django/Dockerfile
|
dockerfile: ./compose/production/django/Dockerfile
|
||||||
|
{%- if cookiecutter.use_whitenoise == 'n' %}
|
||||||
|
args:
|
||||||
|
# These variable can be defined in an .env file in the root of the repo
|
||||||
|
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
||||||
|
DJANGO_AWS_STORAGE_BUCKET_NAME: ${DJANGO_AWS_STORAGE_BUCKET_NAME}
|
||||||
|
DJANGO_AWS_S3_CUSTOM_DOMAIN: ${DJANGO_AWS_S3_CUSTOM_DOMAIN}
|
||||||
|
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
||||||
|
DJANGO_GCP_STORAGE_BUCKET_NAME: ${DJANGO_GCP_STORAGE_BUCKET_NAME}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
image: {{ cookiecutter.project_slug }}_production_django
|
image: {{ cookiecutter.project_slug }}_production_django
|
||||||
platform: linux/x86_64
|
platform: linux/x86_64
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user