Skip to content

Commit

Permalink
refactor: organize local artifacts into dir
Browse files Browse the repository at this point in the history
code and data related to running and testing the app locally
  • Loading branch information
thekaveman committed Jun 10, 2021
1 parent 03ec645 commit 536cc0b
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.git/
.github/
.vscode/
keys/
server/
localhost/
**/__pycache__/
.devcontainer.json
.flake8
Expand Down
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DJANGO_ADMIN=false
DJANGO_ALLOWED_HOSTS="localhost 127.0.0.1 [::1]"
DJANGO_DB=django
DJANGO_DEBUG=true
DJANGO_INIT_PATH=data/client.json
DJANGO_INIT_PATH=localhost/data/client.json
DJANGO_LOCAL_PORT=8000
DJANGO_LOG_LEVEL=DEBUG
DJANGO_SECRET_KEY=secret
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/server",
"localRoot": "${workspaceFolder}/localhost/server",
"remoteRoot": "/usr/src/server"
}
]
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ After initialization, the client is running at `http://localhost:${DJANGO_LOCAL_
If `DJANGO_ADMIN=true`, the backend administrative interface can be accessed with the superuser you setup at
<http://localhost:8000/admin>.

By default, sample data from [`data/client.json`](./data/client.json) is used to initialize Django. Alternatively you may:
By default, sample data from [`localhost/data/client.json`](./localhost/data/client.json) is used to initialize Django.
Alternatively you may:

* Modify the sample data file; or
* Point `DJANGO_INIT_PATH` at a different data file; or
Expand All @@ -59,7 +60,7 @@ docker-compose up [-d] --build server

The API endpoint is running at `http://localhost:5000/verify`.

Sample users and eligibility can be found in [`data/server.json`](./data/server.json).
Sample users and eligibility can be found in [`localhost/data/server.json`](./localhost/data/server.json).

## Development

Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
dev:
build:
context: .
dockerfile: Dockerfile.dev
dockerfile: ./localhost/Dockerfile.dev
image: benefits_client:dev
environment:
- ANALYTICS_KEY
Expand Down Expand Up @@ -53,7 +53,7 @@ services:
- .:/home/calitp/app:cached

server:
build: ./server
build: ./localhost/server
image: eligibility_verification_server:dev
command: python -m debugpy --listen 0.0.0.0:5789 app.py
environment:
Expand All @@ -64,9 +64,9 @@ services:
- "5000:5000"
- "5789:5789"
volumes:
- ./server:/usr/src/server:cached
- ./data:/usr/src/server/data
- ./keys:/usr/src/server/keys
- ./localhost/server:/usr/src/server:cached
- ./localhost/data:/usr/src/server/data
- ./localhost/keys:/usr/src/server/keys

s3config:
image: amazon/aws-cli
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/app.py → localhost/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ def get(self):


if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
app.run(host="0.0.0.0", debug=True) # nosec
File renamed without changes.
File renamed without changes.

0 comments on commit 536cc0b

Please sign in to comment.