Skip to content

Commit

Permalink
switch to Flask (#103)
Browse files Browse the repository at this point in the history
* switch to Flask, new GitHub Action workflows
  • Loading branch information
sepulworld authored Mar 31, 2022
1 parent b225b03 commit fa2ea35
Show file tree
Hide file tree
Showing 20 changed files with 2,211 additions and 1,674 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 160
58 changes: 58 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base

#
# Documentation:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [master]
# Remove the line above to run when pushing to master
pull_request:
branches: [master]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_BLACK: true
VALIDATE_PYTHON_FLAKE8: true
# Change to 'master' if your main branch differs
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.pyc
__pycache__
.venv/
dinghy_ping.egg-info/
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This file is used to list changes made in each version of the Dinghy-ping

## unreleased

## v1.0.0 (2022-03-29)
- [Zane]
- rebuild application using Flask, dropping Responder framework

## v0.5.2 (2022-03-24)
- [Zane]
- fixing websocket support to work with Tilt localhost development
Expand Down
34 changes: 28 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
FROM kennethreitz/pipenv
FROM python:3.10.4-buster

ENV DD_SERVICE_NAME="dinghy-ping"
ENV DD_AGENT_HOST=localhost
ENV DD_DOGSTATSD_SOCKET=""
ENV YOUR_ENV=${YOUR_ENV} \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.1.13 \
DD_SERVICE_NAME="dinghy-ping" \
DD_AGENT_HOST=localhost \
DD_DOGSTATSD_SOCKET=""

EXPOSE 80/tcp 8000/tcp

# System deps:
RUN pip install "poetry==$POETRY_VERSION"

# Copy only requirements to cache them in docker layer
WORKDIR /app
COPY poetry.lock pyproject.toml /app/

# Project initialization:
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi

# Creating folders, and files for a project:
COPY . /app
EXPOSE 80/tcp

ENV PYTHONPATH=/app/
CMD ddtrace-run python3 /app/dinghy_ping/services/api.py
ENTRYPOINT ["./boot.sh"]
# CMD ddtrace-run python /app/dinghy_ping/services/api.py
35 changes: 0 additions & 35 deletions Pipfile

This file was deleted.

Loading

0 comments on commit fa2ea35

Please sign in to comment.