-
-
Notifications
You must be signed in to change notification settings - Fork 65
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 #170 from sympy/dockerize
Dockerize the project for easy development and testing
- Loading branch information
Showing
9 changed files
with
140 additions
and
143 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
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,27 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: ./docker/app/Dockerfile | ||
image: app | ||
container_name: 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: 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,38 @@ | ||
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 Google Chrome for running tests | ||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub -P /usr/src/ | apt-key add - | ||
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | ||
RUN apt-get -y update | ||
RUN apt-get install -y google-chrome-stable | ||
|
||
# Set display port to avoid crash | ||
ENV DISPLAY=:99 | ||
|
||
COPY . . | ||
|
||
# Install chromedriver | ||
RUN wget https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_linux64.zip -P /usr/src/ | ||
RUN unzip -q /usr/src/chromedriver_linux64.zip -d /usr/local/bin/ | ||
|
||
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 |
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