-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add justfile, docker-compose config * Switch to python 3.9 * Update documentation, lint * Add note about IS_PROD
- Loading branch information
1 parent
0c75c79
commit 4867ac8
Showing
5 changed files
with
71 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3" | ||
|
||
services: | ||
app: | ||
build: . | ||
environment: | ||
FLASK_ENV: development | ||
FLASK_DEBUG: 1 | ||
command: flask run --host=0.0.0.0 --port 3030 | ||
volumes: | ||
- ./src:/app |
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,12 @@ | ||
version: "3" | ||
|
||
services: | ||
app: | ||
restart: always | ||
build: . | ||
environment: | ||
FLASK_APP: app | ||
FLASK_ENV: production | ||
command: gunicorn --workers=2 --bind 0.0.0.0:3030 app:app | ||
ports: | ||
- "3030:3030" |
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,37 @@ | ||
IS_PROD := env_var_or_default("IS_PROD", "") | ||
COMPOSE_FILE := "-f docker-compose.yml " + if IS_PROD == "true" {""} else {"-f docker-compose.override.yml "} | ||
DC := "docker-compose " + COMPOSE_FILE | ||
RUN := DC + " run --rm app" | ||
set dotenv-load := false | ||
|
||
|
||
default: | ||
@just -lu | ||
|
||
# Build all containers | ||
build: | ||
{{ DC }} build | ||
|
||
# Print the docker-compose config | ||
config: | ||
{{ DC }} config | ||
|
||
# Spin up all (or the specified) services | ||
up service="": | ||
{{ DC }} up -d {{ service }} | ||
|
||
# Tear down all services | ||
down: | ||
{{ DC }} down | ||
|
||
# Attach logs to all (or the specified) services | ||
logs service="": | ||
{{ DC }} logs -f {{ service }} | ||
|
||
# Run a command using the web image | ||
run +args: | ||
{{ RUN }} {{ args }} | ||
|
||
# Run the static checks | ||
lint: | ||
pre-commit run --all-files |