File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -59,5 +59,6 @@ testing/k6/notebooks/
5959# autogenerated api docs
6060apps /outreach /src /content /docs /en /runtime-core-docs /
6161
62- # mongodb
62+ # docker dbs
6363mongo /
64+ sqlite /
Original file line number Diff line number Diff line change 11FROM node:iron-alpine AS base
22WORKDIR /app
33ARG RELEASE_VERSION
4- ENV GATEWAY_DATABASE_URL=file:/app/gateway.db
4+ ENV GATEWAY_DATABASE_URL=file:/app/sqlite/ gateway.db
55ENV PNPM_HOME="/pnpm"
66ENV PATH="$PNPM_HOME:$PATH"
77ENV NODE_OPTIONS="--max-old-space-size=8192"
@@ -25,12 +25,13 @@ RUN turbo run db:push --filter=@opendatacapture/gateway
2525
2626# RUN SERVER
2727FROM base AS runner
28- COPY --from=installer /app/gateway.db /app/gateway.db
28+ COPY apps/gateway/scripts/run.sh run.sh
29+ COPY --from=installer /app/sqlite/gateway.db /app/gateway.tmpl.db
2930COPY --from=installer /app/apps/gateway/dist/ /app/dist/
3031COPY --from=installer /app/apps/gateway/public/ /app/public/
3132COPY --from=installer /app/apps/gateway/dist/runtime/ /runtime/
3233COPY --from=installer /app/apps/gateway/dist/prisma/client/ /.prisma/client/
3334
3435RUN echo '{ "type": "module" }' > package.json
3536RUN echo '{ "type": "module" }' > /runtime/package.json
36- CMD [ "node" , "./dist/main.js " ]
37+ CMD [ "./run.sh " ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ DATABASE_FILE=${GATEWAY_DATABASE_URL# file: }
4+ EMPTY_DATABASE_FILE=" /app/gateway.tmpl.db"
5+
6+ if [[ ! -f " $DATABASE_FILE " ]]; then
7+ cp " $EMPTY_DATABASE_FILE " " $DATABASE_FILE "
8+ fi
9+
10+ node ./dist/main.js
Original file line number Diff line number Diff line change 11name : open-data-capture
22volumes :
33 caddy_data :
4- mongo_config :
5- mongo_data :
64services :
75 caddy :
86 image : caddy:2.7-alpine
@@ -66,6 +64,8 @@ services:
6664 environment :
6765 - NODE_ENV=production
6866 - GATEWAY_API_KEY
67+ volumes :
68+ - ./sqlite:/app/sqlite
6969 web :
7070 image : ghcr.io/douglasneuroinformatics/open-data-capture-web:${RELEASE_CHANNEL}
7171 build :
You can’t perform that action at this time.
0 commit comments