Skip to content

Commit 744c01a

Browse files
committed
fix ci
1 parent 9f76f13 commit 744c01a

File tree

4 files changed

+83
-31
lines changed

4 files changed

+83
-31
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,27 @@ jobs:
2323
docker compose version
2424
docker compose -f docker-compose.dev.yml build
2525
docker compose -f docker-compose.dev.yml up -d
26-
docker compose -f docker-compose.dev.yml exec -T reproschema python -m pytest tests/
26+
docker compose -f docker-compose.dev.yml exec -T reproschema-server python -m pytest tests/
2727
docker compose -f docker-compose.dev.yml down
2828
env:
29+
# Core settings
2930
NODE_ENV: development
31+
CONTAINER_NAME: reproschema-server
32+
33+
# Schema configuration
34+
SCHEMA_SOURCE: https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema
35+
SCHEMA_PATH: ./schemas
36+
37+
# Data paths
38+
DATA_PATH: ./data
39+
40+
# Project configuration
41+
PROJECT_NAME: development # Match development environment
42+
43+
# Development settings
3044
DEV_MODE: 1
31-
PROJECT_NAME: development
32-
SCHEMA_URL: http://localhost:80/schema/demo-protocol.json
33-
LOCAL_SCHEMA_DIR: ./schemas
34-
FRONTEND_PORT: 3000
35-
BACKEND_PORT: 8000
36-
PORT: 80
37-
NGINX_HOST: localhost
45+
ADMIN_MODE: true
46+
DEBUG_MODE: true
3847

3948
docker:
4049
needs: test
@@ -51,6 +60,9 @@ jobs:
5160
password: ${{ secrets.GITHUB_TOKEN }}
5261

5362
- name: Build and push Docker images
63+
env:
64+
NODE_ENV: production # Ensure production build
65+
PROJECT_NAME: reproschema # Use production name
5466
run: |
5567
docker compose -f docker-compose.yml build
5668
docker compose -f docker-compose.yml push

docker-compose.dev.yml

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,79 @@
11
version: '3.8'
2-
32
services:
4-
reproschema:
3+
reproschema-server:
4+
container_name: ${CONTAINER_NAME:-reproschema-server}
55
build:
66
context: .
77
dockerfile: docker/Dockerfile
88
args:
9-
- NODE_ENV=development
9+
NODE_VERSION: "18"
10+
SCHEMA_SOURCE: ${SCHEMA_SOURCE:-https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema}
11+
ASSETS_PUBLIC_PATH: ${ASSETS_PUBLIC_PATH:-/} # uppercase, consistent
1012
ports:
1113
- "${PORT:-80}:80"
12-
- "8000:8000"
14+
- "8000:8000" # Backend API port
1315
volumes:
14-
# Development-specific volume mounts
15-
- ./docker/frontend:/usr/src/app
16-
- /usr/src/app/node_modules
17-
- ./docker/backend:/app
18-
- ./tests:/app/tests
19-
# Production volume mounts
16+
# Local schema mount (only used when SCHEMA_SOURCE=local)
2017
- ${SCHEMA_PATH:-./schemas}:/schemas:ro
21-
- ${DATA_PATH:-./data}:/data
18+
# Data storage volume
19+
- ${DATA_PATH:-./data}:/data:rw
2220
environment:
23-
# Development-specific settings
24-
- NODE_ENV=development
25-
- VUE_APP_HOT_RELOAD=true
26-
- DEV_MODE=1
21+
# Core settings
22+
- NODE_ENV=${NODE_ENV:-development} # Default to development
2723

28-
# Core settings from production
24+
# Schema configuration
2925
- SCHEMA_SOURCE=${SCHEMA_SOURCE:-https://raw.githubusercontent.com/ReproNim/demo-protocol/main/DemoProtocol/DemoProtocol_schema}
26+
27+
# UI configuration
28+
- BANNER=${BANNER:-Reproschema Protocol}
29+
- START_BUTTON=${START_BUTTON:-Start}
30+
- STUDY_PREFIX=${STUDY_PREFIX:-study}
31+
32+
# Backend configuration
3033
- REPROSCHEMA_BACKEND_BASEDIR=/data
31-
- INITIAL_TOKEN=${INITIAL_TOKEN:-}
34+
# For development mode
35+
- DEV8dac6d02a913=${DEV_MODE:-1}
3236
- BACKEND_URL=${BACKEND_URL:-/api}
37+
# Project name for data organization
38+
- PROJECT_NAME=${PROJECT_NAME:-development} # Default to development
39+
40+
# Development settings
41+
- DEV_MODE=${DEV_MODE:-1} # Default to development mode ON
42+
- ADMIN_MODE=${ADMIN_MODE:-true}
43+
- DEBUG_MODE=${DEBUG_MODE:-true}
3344

34-
# Override SCHEMA_URL for development if needed
35-
- VUE_APP_SCHEMA_URL=${SCHEMA_URL:-http://localhost:${PORT:-80}/schema/demo-protocol.json}
36-
37-
# Development-specific command to enable hot reloading
38-
command: sh -c "npm run serve & uvicorn main:app --host 0.0.0.0 --port ${BACKEND_PORT:-8000} --reload"
45+
# Additional configuration
46+
- VALIDATE_SCHEMA=${VALIDATE_SCHEMA:-true}
47+
- SCHEMA_TYPE=${SCHEMA_TYPE:-jsonld}
48+
49+
# Runtime configuration
50+
- ASSETS_PUBLIC_PATH=${ASSETS_PUBLIC_PATH:-/} # Use same default as build arg
51+
52+
healthcheck:
53+
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
54+
interval: 30s
55+
timeout: 10s
56+
retries: 3
57+
start_period: 15s
58+
restart: unless-stopped
59+
logging:
60+
driver: "json-file"
61+
options:
62+
max-size: "10m"
63+
max-file: "3"
64+
networks:
65+
- reproschema-net
3966

4067
volumes:
4168
participant_data:
42-
name: ${PROJECT_NAME:-reproschema}_data
69+
name: ${PROJECT_NAME:-reproschema}_data
70+
driver: local
71+
driver_opts:
72+
type: none
73+
device: ${DATA_PATH:-./data}
74+
o: bind
75+
76+
networks:
77+
reproschema-net:
78+
name: ${PROJECT_NAME:-reproschema}_network
79+
driver: bridge

docker/backend/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ async def health_check(request):
3737

3838
@app.get("/api/token")
3939
async def get_token(request):
40+
print("Token request:", request.args) # Debug token requests
4041
token = request.args.get('token')
4142
project = request.args.get('project', os.getenv('STUDY_PREFIX', 'study'))
4243
expiry_minutes = int(request.args.get('expiry_minutes', 90))
@@ -73,6 +74,8 @@ async def register(request):
7374

7475
@app.post("/api/responses")
7576
async def submit_data(request):
77+
print("Response headers:", request.headers) # Debug headers
78+
print("Response data:", request.json) # Debug data
7679
auth_token = request.headers.get('Authorization')
7780

7881
# Strip "Bearer " prefix if present

docs/api-testing.md

Whitespace-only changes.

0 commit comments

Comments
 (0)