Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
QMAPS-2334 fix readonly fs gunicorn pid file (#286)
Browse files Browse the repository at this point in the history
Co-authored-by: Aureliano Sinatra <a.sinatra@qwant.com>
  • Loading branch information
aureliano sinatra and Aureliano Sinatra committed Nov 26, 2021
1 parent 24bf00e commit 199c907
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
on:
pull_request:
push:
branches:
- 'master'
- 'es7'
tags:
- 'v*'
on: [push, pull_request]

env:
DOCKER_IMAGE_BASENAME: qwantresearch/idunn
Expand All @@ -16,8 +9,31 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Extract branch name
if: github.event_name != 'pull_request'
run: |
REF=${GITHUB_REF#refs/*/}
if [ "$REF" == "master" ]; then
IMAGE_TAG=latest
else
# Replace '/' with '__'
IMAGE_TAG=${REF//\//__}
fi
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Extract branch name
if: github.event_name == 'pull_request'
run: |
echo "IMAGE_TAG=$GITHUB_HEAD_REF" >> $GITHUB_ENV
# extract branch name on pull request
- name: Print branch name
run: echo "${IMAGE_TAG}"

- name: Set env variables
run: |
echo "DOCKER_IMAGE=${DOCKER_IMAGE_BASENAME}:$IMAGE_TAG" >> $GITHUB_ENV
- name: Login to DockerHub
if: github.event_name == 'push'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -39,5 +55,7 @@ jobs:
- run: docker build --label "org.label-schema.vcs-ref=$GITHUB_SHA" -t $DOCKER_IMAGE .

- if: github.event_name == 'push'
run: docker push $DOCKER_IMAGE
- name: Docker push
if: github.event_name == 'push' || github.event_name == 'pull_request'
run: |
docker push $DOCKER_IMAGE
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ EXPOSE 5000

# You can set the number of workers by passing --workers=${NB_WORKER} to the docker run command.
# For some reason, an array is required here to accept other params on run.
ENTRYPOINT ["gunicorn", "app:app", "--bind=0.0.0.0:5000", "--pid=pid", \
ENTRYPOINT ["gunicorn", "app:app", "--bind=0.0.0.0:5000", "--pid=/tmp/gunicorn.pid", \
"-k", "uvicorn.workers.UvicornWorker", "--preload"]

0 comments on commit 199c907

Please sign in to comment.