# docker-compose.yml — this app and the SurveyJS service, side by side. # # docker compose up --build → http://localhost:8000 (the relays run in the app, on /ws/) # docker compose up -d surveyjs → only the service, on http://localhost:3010 (see docker-compose.override.yml) # # The image includes settings.env (rebuild after changing it: `docker compose up --build`). The private keys come # from your shell or from .env (see .env.example). The relays and the sandbox pruner run inside the app's one # process, so there are no relay or scheduler services. # One project name for every checkout, so a second clone or worktree manages these containers instead of # starting a second surveyjs service that fails on port 3010. Not surveyjs-python: that is surveyjs-python-fastapi's, # and sharing it would let one checkout manage the other's containers. Only one of the two Python repos' services can # publish 3010 at a time; both run the same pinned service, so either serves both apps. name: surveyjs-python-django services: app: # your backend: this Django app (creates and seeds the database on start) build: . ports: ["8000:8000"] environment: SURVEYJS_SERVICE_URL: http://surveyjs:3000 # The private keys; every other setting comes from settings.env in the image DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-} # unset: a generated key on the storage volume SURVEYJS_LICENSE_KEY: ${SURVEYJS_LICENSE_KEY:-} AI_API_KEY: ${AI_API_KEY:-} OPENAI_API_KEY: ${OPENAI_API_KEY:-} # only to tell the extract-from-paper page whether extraction is configured ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-} SURVEYJS_BUILD: ${SURVEYJS_BUILD:-} volumes: [storage:/app/storage] depends_on: [surveyjs] surveyjs: # SurveyJS service (Node.js): SurveyJS Server, built from a pinned commit build: context: https://github.com/surveyjs/surveyjs-server.git#db1ac24b5f984511bbac463c890b6b0a3ebd2dc9 # The repository's Dockerfile at this commit, on Node 24 (20 is out of support, and npm on Node 22 # fails to install it), plus git in both stages: without it, `npm install --omit=dev` fails on a # devDependency that is a git URL. dockerfile_inline: | FROM node:24-alpine AS build WORKDIR /app RUN apk add --no-cache git COPY package*.json ./ RUN npm install COPY tsconfig.json ./ COPY src ./src RUN npm run build FROM node:24-alpine WORKDIR /app ENV NODE_ENV=production RUN apk add --no-cache git COPY package*.json ./ RUN npm install --omit=dev COPY --from=build /app/dist ./dist EXPOSE 3000 CMD ["npm", "start"] # The AI provider the service extracts with: SURVEYJS_AI_* from settings.env (or .env), under the names the # service reads, and the provider's key from .env. No licence key (this revision ignores it). env_file: - settings.env - path: .env required: false command: ["sh", "-c", "export AI_PROVIDER=\"$$SURVEYJS_AI_PROVIDER\" AI_MODEL=\"$$SURVEYJS_AI_MODEL\" OLLAMA_BASE_URL=\"$$SURVEYJS_OLLAMA_BASE_URL\"; exec npm start"] expose: ["3000"] # reachable by the app only volumes: storage: # the SQLite database, uploads, visitor sandboxes and relay snapshots