-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker) integrate fonzie in an Open edX stack (#3)
** FEATURE DETAILS ** Switch to a docker-based environment using fun-platform docker images [1] to integrate Fonzie in an Open edX dockerized stack. Here are the steps we followed to implement this feature: - use fun-platform base docker image - override required settings to install fonzie app and its urls - use docker containers for all Makefile targets - add shortcut scripts in bin/ directory to ease running: - docker-compose - docker-compose build - docker-compose run - tox - ci - use Fonzie's container in TravisCI [1] https://github.com/openfun/fun-platform/ ** FIXES ** - Update project baseline to: 'Fonzie, a FUN API for Open edX' ** REMARKS ** Stick fonzie dependencies to current edx-platform (ginkgo) pinned releases for Django (1.8.18) and Django Rest Framework (aka DRF, 3.2.3). These are temporary contraints. We will upgrade Django and DRF when Open edX will switch to Django 1.11 for the upcoming release (Hawthorn). We will then restore OpenAPI schema (thanks to drf_openapi). ** KNOWN ISSUES ** pyopenssl package needs to be rebuild in a supplementary step of our Dockerfile to avoid SSL handbrake issues.
- Loading branch information
Showing
37 changed files
with
562 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.coverage | ||
.coveragerc | ||
.git | ||
.tox | ||
.tx | ||
node_modules | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM fundocker/edxapp:ginkgo.1-dev | ||
|
||
# Dependencies | ||
ENV DOCKERIZE_VERSION v0.6.0 | ||
|
||
# Get container user and group ids via build arguments | ||
# Default: 0:0 (root:root) | ||
ARG user=0 | ||
ARG group=0 | ||
|
||
# Add a non-privileged user to run the application | ||
RUN groupadd --gid $group app && \ | ||
useradd --uid $user --gid $group --home /app --create-home app | ||
|
||
# Install dockerize | ||
RUN curl -L \ | ||
--output dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ | ||
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ | ||
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||
|
||
# Install project requirements | ||
ADD ./requirements /app/fonzie/requirements | ||
RUN pip install -q --exists-action w \ | ||
-r /app/fonzie/requirements/dev.txt \ | ||
-r /app/fonzie/requirements/private.* | ||
|
||
# Add application sources | ||
ADD . /app/fonzie/ | ||
|
||
# Install django application in development mode | ||
RUN cd /app/fonzie && \ | ||
pip install -e . | ||
|
||
# FIXME: pyopenssl seems to be linked with a wrong openssl release leading to | ||
# bad handskake ssl errors. This looks ugly, but forcing pyopenssl | ||
# re-installation solves this issue. | ||
RUN pip install -U pyopenssl | ||
|
||
# Run container with the $user:$group user | ||
# | ||
# We recommand to build the container with the following build arguments to map container user | ||
# with the HOST user: | ||
# docker build --build-arg user=$(id -u) --build-arg group=$(id -g) | ||
USER $user:$group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
source "$(dirname "${BASH_SOURCE[0]}")/config.sh" | ||
|
||
_dc_build "$@" |
Oops, something went wrong.