Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running in Docker #4

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create and deploy Docker image

on: [push, pull_request]

jobs:
build-develop-docker-image:
runs-on: ubuntu-latest
# Run only on develop branch
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v3
- name: Build and publish develop Docker image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: hsldevcom/transitdata-monitor-data-collector
username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }}
tags: develop
build-release-docker-image:
runs-on: ubuntu-latest
# Run only for tagged commits
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Build and publish release Docker image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: hsldevcom/transitdata-monitor-data-collector
username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }}
tag_semver: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
access_token.txt
.idea
__pycache__
venv
.DS_Store
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3

COPY *.py requirements.txt /app/
WORKDIR /app

RUN ["pip3", "install", "-r", "requirements.txt"]
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
paho-mqtt==1.6.1
python-dotenv==0.20.0
gtfs-realtime-bindings==0.0.7
protobuf<=3.20.1
requests