Skip to content
Snippets Groups Projects
Select Git revision
  • b61ac547bca6c3c35ca58d6e86e8f0d0a53a2c3d
  • master default
  • test protected
  • pdp
  • localwebs
  • target-groups
  • seo1
  • fix1
8 results

Dockerfile

Blame
  • Forked from TO / Maják
    Source project has a limited visibility.
    Dockerfile 1.04 KiB
    FROM python:3.10
    
    RUN mkdir /app
    WORKDIR /app
    
    RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash -
    RUN apt-get install nodejs && rm -rf /var/lib/apt/lists/*
    
    COPY . .
    
    RUN pip install -r requirements/base.txt -r requirements/production.txt
    RUN npm install
    RUN npm run build
    
    # Placeholder values so the static files collect
    RUN DATABASE_URL=postgres://x/x \
        SECRET_KEY=x \
        ALLOWED_HOSTS=x \
        SITE_URL=x \
        OIDC_RP_REALM_URL=x \
        OIDC_RP_CLIENT_ID=x \
        OIDC_RP_CLIENT_SECRET=x \
        DEFAULT_COUNTRY=x \
        DEFAULT_CONTRACTEE_NAME=x \
        DEFAULT_CONTRACTEE_STREET=x \
        DEFAULT_CONTRACTEE_ZIP=x \
        DEFAULT_CONTRACTEE_DISTRICT=x \
        DEFAULT_CONTRACTEE_ICO_NUMBER=x \
        DEFAULT_STAFF_GROUP=x \
        python manage.py collectstatic --noinput --settings=registry.settings.production
    
    RUN bash -c "adduser --disabled-login --quiet --gecos app app &&  \
                 chmod -R o+r /app/ && \
                 chmod o+x /app/run.sh"
    USER app
    
    ENV DJANGO_SETTINGS_MODULE "registry.settings.production"
    
    EXPOSE 8000
    
    CMD ["bash", "run.sh"]