-
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.
* Add .devcontainer goodness. * Fix issue.
- Loading branch information
Showing
7 changed files
with
156 additions
and
1 deletion.
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,28 @@ | ||
{ | ||
"name": "Full Stack Development Environment", | ||
"dockerComposeFile": "../dev-compose.yml", | ||
"service": "dev", | ||
"workspaceFolder": "/testworks", | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/usr/local/bin/python" | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"esbenp.prettier-vscode", | ||
"dbaeumer.vscode-eslint" | ||
], | ||
"forwardPorts": [ | ||
3000, | ||
8000 | ||
], | ||
"containerEnv": { | ||
"DATABASE_URL": "postgresql://testuser:testpassword@db:5432/test", | ||
"REDIS_URL": "redis://redis:6379", | ||
"ALGORITHM": "HS256", | ||
"SECRET_KEY": "1<3TwoTestThings!123456789", | ||
"REACT_APP_API_URL": "http://localhost:8000" | ||
}, | ||
"postCreateCommand": "echo 'Environment setup complete!'", | ||
"remoteUser": "root" | ||
} |
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,6 @@ | ||
.coverage | ||
.env | ||
report.html | ||
test.Dockerfile | ||
__pycache__/ | ||
node_modules/ |
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 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run FastAPI", | ||
"type": "shell", | ||
"command": "uvicorn", | ||
"args": [ | ||
"backend.app.main:app", | ||
"--reload", | ||
"--host=0.0.0.0", | ||
"--port=8000" | ||
], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "start", | ||
"path": "frontend", | ||
"problemMatcher": [], | ||
"label": "npm: start - frontend", | ||
"detail": "react-scripts start", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
markers = | ||
unit: | ||
integration: | ||
e2e: | ||
model: | ||
schema: | ||
generate_report_on_test = True |
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,42 @@ | ||
version: '3.8' | ||
services: | ||
db: | ||
image: postgres:16.2 | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: testuser | ||
POSTGRES_PASSWORD: testpassword | ||
POSTGRES_DB: test | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -U testuser -d test" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
redis: | ||
container_name: redis | ||
image: "redis:alpine" | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
- redis_data:/data | ||
|
||
dev: | ||
build: | ||
context: . | ||
dockerfile: dev.Dockerfile | ||
ports: | ||
- "3000:3000" | ||
- "8000:8000" | ||
volumes: | ||
- .:/testworks | ||
command: ["sleep", "infinity"] | ||
depends_on: | ||
- db | ||
|
||
volumes: | ||
postgres_data: | ||
redis_data: |
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,38 @@ | ||
FROM ubuntu:22.04 AS base | ||
|
||
# Install system dependencies | ||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
python3 \ | ||
python3-pip \ | ||
python3-dev \ | ||
libpq-dev \ | ||
gcc \ | ||
nodejs \ | ||
npm \ | ||
git \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY .vscode ./testworks/ | ||
WORKDIR /testworks/backend | ||
|
||
RUN pip install psycopg2-binary==2.9.9 poetry==1.8.3 | ||
RUN poetry config virtualenvs.create false | ||
COPY ./backend /testworks/backend/ | ||
RUN poetry install --no-dev --no-interaction --no-ansi | ||
ENV PYTHONUNBUFFERED=1 | ||
EXPOSE 8000 | ||
|
||
COPY ./tests /testworks/tests | ||
WORKDIR /testworks/tests | ||
RUN poetry install --no-dev --no-interaction --no-ansi | ||
RUN playwright install chromium | ||
|
||
WORKDIR /testworks/frontend | ||
COPY ./frontend/package*.json /testworks/frontend/ | ||
RUN npm install | ||
COPY ./frontend /testworks/frontend | ||
RUN npm run build | ||
RUN npm install -g serve | ||
EXPOSE 3000 |
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,5 @@ | ||
[pytest] | ||
markers = | ||
integration: | ||
e2e: | ||
generate_report_on_test = True |