Skip to content

Commit

Permalink
dockerfile user
Browse files Browse the repository at this point in the history
  • Loading branch information
Signorini committed Mar 28, 2020
1 parent c6c4b7f commit e6b368d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM maestroserver/maestro-python-gcc

COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

ENV APP_PATH=/opt/application

WORKDIR $APP_PATH

COPY docker-entrypoint.sh /usr/local/bin/
COPY ./app $APP_PATH/app
COPY ./instance $APP_PATH/instance
COPY requirements.txt requirements.txt
COPY package.json package.json
COPY run.py $APP_PATH/run.py
COPY gunicorn_config.py /opt/gunicorn_config.py

RUN pip3 install --upgrade pip gunicorn
RUN pip3 install -r requirements.txt
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN addgroup -S app && adduser -S app -G app
RUN pip3 install --upgrade pip gunicorn && \
pip3 install -r requirements.txt

USER app
ENTRYPOINT ["/sbin/tini","-g","--"]
CMD ["docker-entrypoint.sh"]
8 changes: 3 additions & 5 deletions DockerfileCelery
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM maestroserver/maestro-python-gcc

COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

ENV APP_PATH=/opt/application

WORKDIR $APP_PATH

COPY docker-entrypoint.sh /usr/local/bin/
COPY ./app $APP_PATH/app
COPY ./instance $APP_PATH/instance
COPY requirements.txt requirements.txt
COPY package.json package.json
COPY run.py $APP_PATH/run.py

RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN addgroup -S app && adduser -S app -G app
RUN pip3 install -r requirements.txt

USER app
ENTRYPOINT ["/sbin/tini","-g","--"]
CMD ["docker-entrypoint-workers.git sh"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"celery": "celery -A app.celery worker -E -Q discovery --hostname=discovery@%h --loglevel=info",
"save": "pip freeze -l > requirements.txt ",
"test": "python -m unittest discover",
"package-flask": "docker build -t discovery-maestro .",
"package-flask": "docker build -t discovery-maestro -t discovery-maestro .",
"package-celery": "docker build -f DockerfileCelery -t discovery-maestro-celery .",
"docs": "apidoc -i app/controller/ -o docs/"
},
Expand Down

0 comments on commit e6b368d

Please sign in to comment.