-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from sympy/dockerize
Dockerize the project for development
- Loading branch information
Showing
8 changed files
with
138 additions
and
93 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
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
Empty file.
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,27 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: ./docker/app/Dockerfile | ||
image: app | ||
container_name: gamma_app | ||
depends_on: | ||
- datastore | ||
volumes: | ||
- ./app/:/usr/src/app/app/ | ||
ports: | ||
- "8080:8080" | ||
- "8082:8082" | ||
- "8083:8083" | ||
command: /run.sh | ||
|
||
datastore: | ||
build: | ||
context: . | ||
dockerfile: ./docker/datastore/Dockerfile | ||
image: datastore | ||
container_name: gamma_datastore | ||
ports: | ||
- "8081:8081" |
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 python:2-slim | ||
|
||
RUN apt-get update \ | ||
# dependencies for building Python packages | ||
&& apt-get install -y build-essential \ | ||
&& apt-get install -y python-dev \ | ||
&& apt-get install -y wget \ | ||
&& apt-get install -y zip unzip | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements ./requirements | ||
COPY ./docker/app/run.sh /run.sh | ||
|
||
RUN pip install -r requirements/requirements.txt -t lib/ | ||
RUN pip install -r requirements/local_requirements.txt | ||
|
||
# Install App engine SDK | ||
RUN wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.90.zip -nv -P /usr/src/ | ||
RUN unzip -q /usr/src/google_appengine_1.9.90.zip -d /usr/src/ | ||
ENV SDK_LOCATION="/usr/src/google_appengine" | ||
|
||
# Install PhantomJs and Casperjs for Testing | ||
ENV PHANTOM_JS="phantomjs-1.9.8-linux-x86_64" | ||
RUN apt-get install -y chrpath libssl-dev libxft-dev \ | ||
&& apt-get install -y libfreetype6 libfreetype6-dev \ | ||
&& apt-get install -y libfontconfig1 libfontconfig1-dev \ | ||
&& apt-get install -y git | ||
|
||
RUN cd ../ && wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 | ||
RUN mv ../$PHANTOM_JS.tar.bz2 /usr/local/share/ | ||
RUN cd /usr/local/share/ && tar xvjf $PHANTOM_JS.tar.bz2 | ||
RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/share/phantomjs | ||
RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin/phantomjs | ||
RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/bin/phantomjs | ||
RUN rm -rf /usr/local/share/$PHANTOM_JS.tar.bz2 | ||
|
||
RUN cd ../ && git clone git://github.com/casperjs/casperjs.git \ | ||
&& cd casperjs && ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs | ||
|
||
ENV PYTHONPATH="/usr/src/app" | ||
|
||
COPY . . | ||
|
||
ENTRYPOINT [ "/run.sh" ] |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
HOST="0.0.0.0" | ||
API_PORT="8082" | ||
ADMIN_PORT="8083" | ||
DATASTORE_EMULATOR_HOST_PORT=datastore:8081 | ||
|
||
python $SDK_LOCATION/dev_appserver.py --api_host 0.0.0.0 \ | ||
--api_port "$API_PORT" \ | ||
--admin_host "$HOST" \ | ||
--admin_port "$ADMIN_PORT" \ | ||
--host "$HOST" \ | ||
--skip_sdk_update_check 1 . \ | ||
--env_var DATASTORE_EMULATOR_HOST="$DATASTORE_EMULATOR_HOST_PORT" \ | ||
--env_var DATASTORE_USE_PROJECT_ID_AS_APP_ID=true |
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,8 @@ | ||
FROM google/cloud-sdk:latest | ||
|
||
WORKDIR /usr/src/app | ||
COPY ./docker/datastore/run.sh ./run.sh | ||
|
||
ENV CLOUDSDK_CORE_PROJECT=sympy-live-hrd | ||
|
||
ENTRYPOINT [ "./run.sh" ] |
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,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
gcloud beta emulators datastore start --host-port=0.0.0.0:8081 |