"Fossies" - the Fresh Open Source Software Archive

Member "apache-pulsar-2.6.0/docker/pulsar-standalone/Dockerfile" (9 Jun 2020, 3114 Bytes) of package /linux/misc/apache-pulsar-2.6.0-src.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Dockerfile": 2.5.2_vs_2.6.0.

    1 #
    2 # Licensed to the Apache Software Foundation (ASF) under one
    3 # or more contributor license agreements.  See the NOTICE file
    4 # distributed with this work for additional information
    5 # regarding copyright ownership.  The ASF licenses this file
    6 # to you under the Apache License, Version 2.0 (the
    7 # "License"); you may not use this file except in compliance
    8 # with the License.  You may obtain a copy of the License at
    9 #
   10 #   http://www.apache.org/licenses/LICENSE-2.0
   11 #
   12 # Unless required by applicable law or agreed to in writing,
   13 # software distributed under the License is distributed on an
   14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   15 # KIND, either express or implied.  See the License for the
   16 # specific language governing permissions and limitations
   17 # under the License.
   18 #
   19 
   20 # Using files from pulsar-all docker image for pulsar
   21 FROM apachepulsar/pulsar-all:latest as pulsar
   22 
   23 # Using files from pulsar-dashboard for the dashboard
   24 FROM apachepulsar/pulsar-dashboard:latest as dashboard
   25 
   26 # Restart from
   27 FROM openjdk:8-jdk
   28 
   29 # Note that the libpq-dev package is needed here in order to install
   30 # the required python psycopg2 package (for postgresql) later
   31 RUN apt-get update
   32 RUN apt-get -y install python2.7 python-pip postgresql sudo nginx supervisor libpq-dev
   33 
   34 # Postgres configuration
   35 COPY --from=dashboard /etc/postgresql/11/main/postgresql.conf /etc/postgresql/11/main/postgresql.conf
   36 
   37 # Configure supervisor
   38 COPY --from=dashboard /etc/supervisor/conf.d/supervisor-app.conf /etc/supervisor/conf.d/supervisor-app.conf
   39 
   40 # Add pulsar to supervisord. Redirect logs to stdout
   41 RUN echo "[program:pulsar]\n\
   42 command = /pulsar/bin/pulsar standalone\n\
   43 stdout_logfile=/dev/fd/1\n\
   44 stdout_logfile_maxbytes=0\n\
   45 redirect_stderr=true" >> /etc/supervisor/conf.d/supervisor-app.conf
   46 
   47 # Configure nginx
   48 RUN echo "daemon off;" >> /etc/nginx/nginx.conf
   49 COPY --from=dashboard /etc/nginx/sites-available/default /etc/nginx/sites-available/default
   50 
   51 # Copy pulsar files from pulsar-all
   52 COPY --from=pulsar /pulsar /pulsar
   53 
   54 # Copy web-app sources
   55 COPY . /pulsar/
   56 
   57 # Copy dashboard files from pulsar-dashboard
   58 COPY --from=dashboard /pulsar/django /pulsar/django
   59 COPY --from=dashboard /pulsar/requirements.txt /pulsar/django
   60 COPY --from=dashboard /pulsar/conf/* /pulsar/conf/
   61 
   62 # Python dependencies
   63 RUN pip2 install -r /pulsar/django/requirements.txt
   64 
   65 # Copy web-app sources
   66 # Setup database and create tables
   67 COPY --from=dashboard /pulsar/init-postgres.sh /pulsar/django/init-postgres.sh
   68 RUN mkdir /data
   69 RUN /pulsar/django/init-postgres.sh
   70 RUN sudo -u postgres /etc/init.d/postgresql stop
   71 # Add postgresql to supervisord. Redirect logs to stdout
   72 RUN echo "\n[program:postgresql]\n\
   73 command = /etc/init.d/postgresql start\n\
   74 stdout_logfile=/dev/fd/1\n\
   75 stdout_logfile_maxbytes=0\n\
   76 redirect_stderr=true" >> /etc/supervisor/conf.d/supervisor-app.conf
   77 
   78 # Collect all static files needed by Django in a
   79 # single place. Needed to run the app outside the
   80 # Django test web server
   81 RUN cd /pulsar/django && ./manage.py collectstatic --no-input
   82 
   83 ENV SERVICE_URL http://127.0.0.1:8080
   84 EXPOSE 80 8080 6650
   85 
   86 CMD ["supervisord", "-n"]