Skip to content
Snippets Groups Projects
Select Git revision
  • 9d06874ccc39571b2b7563b021aab40065cc7075
  • test default
  • master protected
3 results

Dockerfile

Blame
  • 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"]