-
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.
[add] tests inside docker and run before start
- Loading branch information
stanislav-web
committed
Oct 30, 2017
1 parent
6ab78d4
commit d7dbb57
Showing
18 changed files
with
153 additions
and
94 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 |
---|---|---|
|
@@ -7,15 +7,18 @@ FROM python:3.6 | |
|
||
MAINTAINER Stanislav WEB "[email protected]" | ||
|
||
ARG SERVERMODE | ||
|
||
COPY . /app | ||
|
||
WORKDIR /app | ||
|
||
# Install requirements | ||
RUN pip install -r requirements.txt | ||
RUN pip install -r requirements-dev.txt | ||
RUN chmod +x server.py | ||
|
||
EXPOSE 5001 | ||
EXPOSE 5000 | ||
|
||
# Set the default command to execute | ||
ENTRYPOINT ["/usr/local/bin/gunicorn", "--config", "./config.py", "server", "--reload"] | ||
ENTRYPOINT ["sh", "./entrypoint.sh", "$SERVERMODE"] |
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
APPLICATION="${APPLICATION}" | ||
printf '\033[32m%s\n' "${APPLICATION}" | ||
|
||
if [ $@ == '--reload' ] | ||
then | ||
/usr/local/bin/gunicorn --config ./config.py server "$@" | ||
else | ||
/usr/local/bin/coverage run setup.py test | ||
/usr/local/bin/coverage report | ||
/usr/local/bin/gunicorn --config ./config.py server | ||
fi |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
coverage==4.4.1 | ||
coveralls==1.2.0 | ||
unittest2py3k==0.5.1 | ||
python-dotenv==0.7.1 | ||
unittest2py3k==0.5.1 |
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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
version: "3.3" | ||
services: | ||
app: | ||
build: ./app | ||
build: | ||
context: ./app | ||
args: | ||
SERVERMODE : "" | ||
restart: always | ||
container_name: app | ||
env_file: | ||
- ./app/env/development.env | ||
volumes: | ||
- ./app:/app | ||
links: | ||
- redis | ||
- redis_db | ||
ports: | ||
- "5001:5001" | ||
redis: | ||
build: ./redis | ||
- "5000:5000" | ||
redis_db: | ||
build: | ||
context: ./redis | ||
args: | ||
ENVMODE : dev | ||
restart: on-failure | ||
container_name: redis | ||
container_name: redis_db | ||
volumes: | ||
- ./redis/config/redis.conf:/usr/local/etc/redis/redis.conf | ||
- ./redis/config/redis-dev.conf:/usr/local/etc/redis/redis.conf | ||
- ./redis/data:/var/lib/redis | ||
ports: | ||
- "6379:6379" | ||
- "6379:6379" |
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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
version: "3.3" | ||
services: | ||
app: | ||
build: ./app | ||
build: | ||
context: ./app | ||
args: | ||
SERVERMODE : "--reload" | ||
restart: always | ||
container_name: app | ||
env_file: | ||
- ./app/env/production.env | ||
volumes: | ||
- ./app:/app | ||
links: | ||
- redis | ||
- redis_db | ||
ports: | ||
- "5000:5000" | ||
redis: | ||
build: ./redis | ||
redis_db: | ||
build: | ||
context: ./redis | ||
args: | ||
ENVMODE : prod | ||
restart: always | ||
container_name: redis | ||
container_name: redis_db | ||
volumes: | ||
- ./redis/config/redis.conf:/usr/local/etc/redis/redis.conf | ||
- ./redis/config/redis-prod.conf:/usr/local/etc/redis/redis.conf | ||
- ./redis/data:/var/lib/redis | ||
ports: | ||
- "6379:6379" |
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 |
---|---|---|
|
@@ -10,6 +10,8 @@ MAINTAINER Stanislav WEB "[email protected]" | |
# or UNIX socket. | ||
################################################# | ||
|
||
COPY ./config/redis.conf /usr/local/etc/redis/redis.conf | ||
ARG ENVMODE | ||
|
||
COPY ./config/redis-$ENVMODE.conf /usr/local/etc/redis/redis.conf | ||
EXPOSE 6379 | ||
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf"] |
Oops, something went wrong.