Skip to content

Commit

Permalink
feat(project): Updated docker image; added project details
Browse files Browse the repository at this point in the history
  • Loading branch information
b32147 committed Aug 5, 2021
1 parent 5e0daf4 commit 770ecdb
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6-alpine3.11 AS builder
FROM python:3.9-alpine3.14 AS builder

# Install dependencies
RUN apk add --update \
Expand All @@ -16,7 +16,7 @@ ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
# Install Python packages
RUN pip install -r /requirements.txt

FROM hmsdbmitc/dbmisvc:alpine-python3.6-0.1.0
FROM hmsdbmitc/dbmisvc:alpine3.14-python3.9-0.1.1

RUN apk add --no-cache --update \
mariadb-connector-c \
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dbmisvc-starter

This repository is a simple starting point for developing and deploying a
service utilizing the various HMS DBMI managed infrastructure and tools.

## 1. Getting Started

1. Setup development environment by checking out repository: `git clone https://github.com/hms-dbmi/dbmisvc-starter && cd dbmisvc-starter`

2. Installing development requirements: `pip install -r requirements-dev.txt`

3. Install pre-commit hooks: `pre-commit install`

4. Build and run stack: `docker-compose up -d`

## 2. Deploying
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
pre-commit==2.*
53 changes: 53 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""dbmisvc-starter setup."""

import os
import re
from setuptools import setup, find_packages


def read_file(filename):
"""Read a file into a string."""
path = os.path.abspath(os.path.dirname(__file__))
filepath = os.path.join(path, filename)
try:
return open(filepath).read()
except IOError:
return ""


def get_readme():
"""Return the README file contents. Supports text,rst, and markdown."""
for name in ("README", "README.rst", "README.md"):
if os.path.exists(name):
return read_file(name)
return ""


def get_version(package):
"""Return package version as listed in `__version__` in `init.py`."""
init_py = open(
os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.path.join(package, "starter", "__init__.py"),
)
).read()
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)


DESC = "A starter application for a DBMI service"
setup(
name="dbmisvc-starter",
version=get_version(),
url="https://github.com/hms-dbmi/dbmisvc-starter",
author="HMS DBMI - Techcore",
author_email="bryan_larson@hms.harvard.edu",
description=DESC,
long_description=get_readme(),
packages=find_packages(),
include_package_data=True,
classifiers=[
"Framework :: Django",
],
)

0 comments on commit 770ecdb

Please # to comment.