From c562be96a8043f6b2a3d85038446fb2300ece8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pogeant?= Date: Tue, 29 Sep 2020 12:12:54 +0200 Subject: [PATCH] Create Dockerhub deployment (#7) --- .github/workflows/deploy.yml | 23 +++++++++++++++++++++++ Dockerfile | 10 ++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 Dockerfile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ce0a013 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +name: Docker deployment + +on: + push: + tags: + - "*" + +jobs: + docker: + runs-on: ubuntu-latest + name: Push Docker images + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Push Docker Hub + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + repository: loscrackitos/transport-api + tags: latest + tag_with_ref: true + push: ${{ startsWith(github.ref, 'refs/tags/') }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..83390b5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.7-alpine +WORKDIR /api +ENV FLASK_APP api.py +ENV FLASK_RUN_HOST 0.0.0.0 +RUN apk add --no-cache git tk-dev gcc musl-dev linux-headers +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt +EXPOSE 5000 +COPY . . +CMD ["flask", "run"]