Skip to content

Commit

Permalink
add source code and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
neoflex committed May 28, 2020
1 parent 16ceab0 commit 685d101
Show file tree
Hide file tree
Showing 235 changed files with 44,499 additions and 77 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git/*
.idea/*
200 changes: 144 additions & 56 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,67 +1,155 @@
*.rbc
capybara-*.html
.rspec
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-[0-9]*
/public/system
/coverage/
/spec/tmp
*.orig
rerun.txt
pickle-email-*.html

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
config/initializers/secret_token.rb
config/master.key

# Only include if you have production secrets in this file, which is no longer a Rails default
# config/secrets.yml

# dotenv
# TODO Comment out this rule if environment variables can be committed
.env
# Created by https://www.gitignore.io/api/intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

## Environment normalization:
/.bundle
/vendor/bundle
*.iml
# modules.xml

# these should all be checked in to normalize the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset
# Created by https://www.gitignore.io/api/python

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# if using bower-rails ignore default bower_components path bower.json files
/vendor/assets/bower_components
*.bowerrc
bower.json
# C extensions
*.so

# Ignore pow environment settings
.powenv
# Distribution / packaging
.Python
env/
build/
develop-eggs/
/dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Ignore Byebug command history file.
.byebug_history
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Ignore node_modules
node_modules/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# Ignore precompiled javascript packs
/public/packs
/public/packs-test
/public/assets
# virtualenv
venv/
ENV/

# Ignore yarn files
/yarn-error.log
yarn-debug.log*
.yarn-integrity
# Spyder project settings
.spyderproject

# Ignore uploaded files in development
/storage/*
!/storage/.keep
# Rope project settings
.ropeproject
.idea
example.db
cache/
pi-squared.db*
datacatalog/static/public/upload
datacatalog/settings.py
datacatalog/static/public/css/common.min.css
datacatalog/static/vendor/node_modules
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Builder stage installs python requirements and builds front-end assets

# Version locked to 3.7, see https://hub.docker.com/_/python
FROM python:3.7-buster as builder

# Force standard IO streams to be unbuffered,
# see https://docs.python.org/2/using/cmdline.html#cmdoption-u
ENV PYTHONUNBUFFERED 1

# Set working directory to /code
WORKDIR /code

# Install the requirements (java for Flask Assets, node/npm for fetching the front-end, ldap for python-ldap)
RUN mkdir -p /code /static && \
apt-get update && \
apt-get install -y openjdk-11-jdk nodejs npm build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev ldap-utils && \
npm install -g lessc less

# Add list of python requirements
COPY setup.py /code/

# Install python requirements
RUN mkdir -p /code/datacatalog/static/vendor && \
pip install -e . \
--default-timeout=180 2>/dev/null || true && \
pip install -r requirements-dev.txt \
--default-timeout=180 2>/dev/null || true && \
pip install gunicorn && \
pip list -vvv

# Add the assets
COPY ./datacatalog/static /code/datacatalog/static

# Compile the assets
RUN cd /code/datacatalog/static/vendor && \
npm install && \
cd /code

# Add the source code (therefore if any backend-related file changes, the build will pick up cache from previous step)
COPY . /code/

# Compile the assets with Flask-Assets
RUN python manage.py assets build

# Complete the installation of the package
RUN pip install -e . && cp -r /code/datacatalog/static/* /static/

# In case you'd like to debug stuff, then the following line would run flask's debug server
# Note, that when using docker-compose, it gets overridden (see `entrypoint` and `cmd` of docker-compose.yml)
ENTRYPOINT ["python"]
CMD ["manage.py", "runserver", "--host", "0.0.0.0"]
Loading

0 comments on commit 685d101

Please sign in to comment.