Merge pull request #7 from mozilla/cleaning

Various changes to Dockerfile
This commit is contained in:
Blake Imsland 2016-08-09 14:52:51 -07:00 коммит произвёл GitHub
Родитель 6405ba708c 4e8f4113c3
Коммит 04c752d550
2 изменённых файлов: 23 добавлений и 15 удалений

Просмотреть файл

@ -1,22 +1,22 @@
# ubuntu 16.04 xenial image
FROM ubuntu
# use base python
FROM python:2.7-alpine
# apt update it
RUN apt-get update
# get essentials
RUN apt-get install -y tar git curl wget dialog net-tools build-essential python python-dev python-distribute python-pip
# install deps
RUN apk add --no-cache bash curl git mailcap tar wget
# add project directory
ADD . /telemetry-schema-service/
# create app directory
RUN mkdir -p /app/
WORKDIR /app/
# pip install requirements.txt
RUN pip install -r /telemetry-schema-service/requirements.txt
# install requirements
COPY requirements.txt /app/
RUN pip install --no-cache-dir --requirement requirements.txt
# exposing 8080 for flask app
# expose 8080 for flask app
EXPOSE 8080
# workdir
WORKDIR /telemetry-schema-service/app
# copy application
COPY . /app/
# run gunicorn
CMD gunicorn -w 4 -b 0.0.0.0:8080 mozschemas_service:app
# run start script
CMD ["bin/start"]

8
bin/start Executable file
Просмотреть файл

@ -0,0 +1,8 @@
#!/bin/bash
set -eo pipefail
: ${WORKERS:=4}
: ${PORT:=8080}
exec gunicorn -w $WORKERS -b 0.0.0.0:$PORT app.mozschemas_service:app