apiVersion: v1
kind: BuildConfig
metadata:
  name: "modernpaste-docker-build"
  labels:
    environment: "modernpaste"
spec:
  runPolicy: Serial
  source:
    dockerfile: |-
      FROM fedora:27
      LABEL \
          name="Modern Paste" \
          vendor="Fedora Infrastructure" \
          license="MIT"
      RUN curl -o /etc/yum.repos.d/infra-stg.repo \
          https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags.repo
      RUN yum -y install modern-paste
      RUN yum -y install --setopt=tsflags=nodocs \
          python-gunicorn \
          python2-mock \
          python-psycopg2
      WORKDIR /usr/share/modern-paste
      RUN sed -i '216,219d;228,229d' app/api/paste.py
      RUN mv modern_paste.wsgi modern_paste_wsgi.py
      USER 1001
      EXPOSE 8080
      ENTRYPOINT gunicorn --bind 0.0.0.0:8080 --access-logfile=- --chdir /usr/share/modern-paste modern_paste_wsgi:application
  strategy:
    type: Docker
  output:
    to:
      kind: ImageStreamTag
      name: inframodernpaste:latest
