-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contains receipts service's project base already dockerided
- Loading branch information
0 parents
commit ca8353c
Showing
11 changed files
with
95 additions
and
0 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,4 @@ | ||
env | ||
.dockerignore | ||
Dockerfile-dev | ||
Dockerfile-prod |
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 @@ | ||
__pycache__ | ||
env | ||
.vscode/ |
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 @@ | ||
# Base Image | ||
FROM python:3.6.5-alpine | ||
|
||
# Setting working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Dealing with requirements | ||
COPY ./requirements.txt /usr/src/app/requirements.txt | ||
RUN pip install -r requirements.txt | ||
|
||
# Coping project | ||
COPY . /usr/src/app | ||
|
||
# Running server | ||
CMD python manage.py run -h 0.0.0.0 |
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,21 @@ | ||
# Configurando o ambiente | ||
Para instruções de como instalar o Docker e o Docker-compose clique [aqui](https://github.com/Kalkuli/2018.2-Kalkuli_Front-End/blob/master/README.md). | ||
|
||
|
||
<br> | ||
|
||
## Colocando no ar | ||
Com o Docker e Docker-Compose instalados, basta apenas utilizar os comandos: | ||
|
||
```docker-compose -f docker-compose-dev.yml build``` | ||
|
||
e | ||
|
||
```docker-compose -f docker-compose-dev.yml up``` | ||
|
||
Acesse o servidor local no endereço apresentado abaixo: | ||
|
||
http://localhost:5006/ | ||
|
||
|
||
Agora você já pode começar a contribuir! |
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,14 @@ | ||
version: '3.6' | ||
services: | ||
users: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-dev | ||
volumes: | ||
- '.:/usr/src/app' | ||
ports: | ||
- 5006:5000 | ||
environment: | ||
- FLASK_APP=project/__init__.py | ||
- FLASK_ENV=development | ||
- APP_SETTINGS=project.config.DevelopmentConfig |
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 @@ | ||
from flask.cli import FlaskGroup | ||
from project import app | ||
|
||
cli = FlaskGroup(app) | ||
|
||
if __name__ == '__main__': | ||
cli() |
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 @@ | ||
import os | ||
from flask import Flask, jsonify | ||
|
||
# Instantiate the app | ||
app = Flask(__name__) | ||
|
||
# Set Configuration | ||
app_settings = os.getenv('APP_SETTINGS') | ||
app.config.from_object(app_settings) | ||
|
||
@app.route('/', methods=['GET']) | ||
def ping_pong(): | ||
return jsonify({ | ||
'data': 'Welcome to Kalkuli Receipts Service' | ||
}) |
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,15 @@ | ||
class BaseConfig: | ||
"""Base configuration""" | ||
TESTING = False | ||
|
||
class DevelopmentConfig(BaseConfig): | ||
"""Development configuration""" | ||
pass | ||
|
||
class TestingConfig(BaseConfig): | ||
"""Testing configuration""" | ||
TESTING = True | ||
|
||
class ProductionConfig(BaseConfig): | ||
"""Production configuration""" | ||
pass |
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 @@ | ||
Flask==1.0.2 |