-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial .devcontainers configuration. This feature is still incomplet…
…e and has is not documented yet
- Loading branch information
1 parent
4b7ce6c
commit 9a9722e
Showing
7 changed files
with
189 additions
and
37 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,41 @@ | ||
####################################### | ||
# Dev configuration for haztrak | ||
|
||
### Django Configs | ||
HT_SECRET_KEY='django-insecure-%btjqoun@6ps$e@8bw$48s+!x1e4aiz&5p2nrf6cmiw4)jsx5d' | ||
HT_HOST=localhost | ||
HT_TIMEZONE=America/New_York | ||
HT_CORS_DOMAIN=http://localhost:3000 | ||
HT_RCRAINFO_ENV=preprod | ||
HT_CACHE_URL=redis://redis:6379 | ||
|
||
### Logging | ||
HT_LOG_LEVEL=INFO | ||
HT_TRAK_LOG_LEVEL=INFO | ||
HT_CORE_LOG_LEVEL=INFO | ||
HT_LOG_FORMAT=verbose | ||
CELERY_LOG_LEVEL=INFO | ||
|
||
### Django Database/ORM configs | ||
# see Django docs https://docs.djangoproject.com/en/4.0/ref/databases/ on database drivers | ||
HT_DB_ENGINE=django.db.backends.postgresql | ||
HT_DB_NAME=haztrak_db | ||
HT_DB_USER=admin | ||
HT_DB_PASSWORD='password1' | ||
HT_DB_PORT=5432 | ||
HT_DB_HOST=db | ||
DJANGO_SETTINGS_MODULE='haztrak.settings.dev' | ||
|
||
### Celery task queue configs | ||
CELERY_RESULT_BACKEND=django-db | ||
CELERY_BROKER_URL=redis://redis:6379 | ||
|
||
### React App configs | ||
VITE_HT_API_URL=http://localhost:8000 | ||
VITE_HT_ENV=DEV | ||
VITE_GITHUB_URL=https://github.com/USEPA/haztrak | ||
|
||
### Postgres | ||
POSTGRES_USER=admin | ||
POSTGRES_PASSWORD=password1 | ||
POSTGRES_DB=haztrak_db |
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 @@ | ||
FROM python:3.12.2-bookworm | ||
LABEL maintainer="[email protected]" | ||
ENV APP_DIRECTORY=/app/server | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
RUN apt install libffi-dev gcc libc-dev | ||
WORKDIR $APP_DIRECTORY | ||
COPY ./server $APP_DIRECTORY | ||
RUN python -m pip install --no-cache-dir --quiet -r requirements.txt | ||
EXPOSE 8000 | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
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,22 @@ | ||
{ | ||
"name": "Python Dev Container", | ||
"dockerComposeFile": ["../docker-compose.yml"], | ||
"service": "trak", | ||
"workspaceFolder": "/app/server", | ||
"customizations": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
}, | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"batisteo.vscode-django", | ||
"streetsidesoftware.code-spell-checker", | ||
"charliermarsh.ruff" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/git: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
version: '3.9' | ||
services: | ||
trak: | ||
container_name: trak | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Trak/Dockerfile | ||
ports: | ||
- '8000:8000' | ||
env_file: | ||
- .env.devcontainer | ||
volumes: | ||
- ..:/app:cached | ||
command: | | ||
sh -c " | ||
cd ./server && | ||
python manage.py makemigrations && | ||
python manage.py migrate && | ||
python manage.py loaddata dev_data.yaml && | ||
python manage.py runserver 0.0.0.0:8000" | ||
depends_on: | ||
- db | ||
|
||
db: | ||
restart: unless-stopped | ||
container_name: db | ||
image: 'postgres:16' | ||
env_file: | ||
- .env.devcontainer | ||
ports: | ||
- '5432:5432' | ||
volumes: | ||
- rdb:/var/lib/postgresql/data | ||
|
||
redis: | ||
container_name: redis | ||
image: 'redis:alpine' | ||
ports: | ||
- '6379:6379' | ||
volumes: | ||
- imdb:/data | ||
|
||
celery-worker: | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Trak/Dockerfile | ||
restart: unless-stopped | ||
container_name: celery-worker | ||
volumes: | ||
- ..:/app:cached | ||
env_file: | ||
- .env.devcontainer | ||
command: | | ||
sh -c "cd ./server && | ||
python manage.py celery_worker" | ||
depends_on: | ||
- redis | ||
- trak | ||
- db | ||
|
||
celery-beat: | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Trak/Dockerfile | ||
restart: unless-stopped | ||
container_name: celery-beat | ||
env_file: | ||
- .env.devcontainer | ||
volumes: | ||
- ..:/app:cached | ||
command: | | ||
sh -c "cd ./server && | ||
python manage.py celery_beat" | ||
depends_on: | ||
- redis | ||
- trak | ||
- db | ||
|
||
client: | ||
container_name: client | ||
build: | ||
context: ../client | ||
target: dev | ||
ports: | ||
- '3000:3000' | ||
volumes: | ||
- ..:/app:cached | ||
env_file: | ||
- .env.devcontainer | ||
command: sh -c "cd /app/client; npm install; npm start" | ||
|
||
volumes: | ||
rdb: | ||
imdb: |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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