Skip to content

Commit

Permalink
Create Dockerhub deployment (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome1337 authored Sep 29, 2020
1 parent 740a941 commit c562be9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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/') }}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit c562be9

Please sign in to comment.