Skip to content

Commit

Permalink
Merge branch 'master' into feat/888/downloading-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewThien authored Dec 11, 2024
2 parents be2cb31 + 1c805f4 commit 35fe75b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
22 changes: 9 additions & 13 deletions app/next-client-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@ RUN \
else echo "Lockfile not found." && exit 1; \
fi

# Building code for dev.
FROM base AS dev

WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Build the app
RUN \
if [ -f package-lock.json ]; then npm run build; \
else echo "Lockfile not found." && exit 1; \
fi
RUN npm run build

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
Expand All @@ -48,10 +50,4 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT=3000

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD HOSTNAME="0.0.0.0" node server.js
CMD ["node", "server.js"]
28 changes: 24 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@ services:
build:
context: app/next-client-app
dockerfile: Dockerfile
target: dev
command: npm run dev
ports:
- 3000:3000
environment:
- BACKEND_URL=http://web:8000
- BACKEND_ORIGIN=localhost:8000
- NEXTAUTH_URL=http://next-client:3000/
- NEXTAUTH_SECRET=verycomplexsecretkey
- NEXTAUTH_BACKEND_URL=http://web:8000/api/
- NODE_ENV=development
- WATCHPACK_POLLING=true
volumes:
- ./app/next-client-app:/next-client-app
- ./app/next-client-app:/app
- /app/node_modules
- /app/.next

omop-lite:
image: ghcr.io/andyrae/omop-lite
Expand Down Expand Up @@ -56,8 +65,10 @@ services:
- AZURE_ACCOUNT_NAME=devstoreaccount1
- AZ_URL=http://workers:80
- AZ_RULES_NAME=RulesOrchestrator
- AZ_RULES_EXPORT_QUEUE=rules=exports-local
- AZ_RULES_KEY=rules_key
- AZ_RULES_EXPORT_QUEUE=rules-exports-local
- STORAGE_CONN_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
- SIGNING_KEY=secret
volumes:
- ./app/api:/api
depends_on:
Expand All @@ -73,13 +84,13 @@ services:
- 8080:80
- 7071:80
environment:
# Set Docker to look for secrets locally
- AzureWebJobsSecretStorageType=files
- IsEncrypted=false
- AzureWebJobsStorage=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
- FUNCTIONS_WORKER_RUNTIME=python
- STORAGE_CONN_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
- APP_URL=http://web:8000/
# The key below needed for authentication and can be obtained through localhost:8000/admin/ --> add tokens
- AZ_FUNCTION_KEY=2d374a1f460fc9627d69e99c6cbeabf3f759d517
# Four queues below need adding to Azure local storage
- SCAN_REPORT_QUEUE_NAME=scanreports-local
- UPLOAD_QUEUE_NAME=uploadreports-local
Expand All @@ -89,9 +100,18 @@ services:
- CHUNK_SIZE=6
# The address that can be used to reach the function app from outside
- WEBSITE_HOSTNAME=localhost:7071
# Database setup
- COCONNECT_DB_ENGINE=django.db.backends.postgresql
- COCONNECT_DB_HOST=db
- COCONNECT_DB_PORT=5432
- COCONNECT_DB_NAME=postgres
- COCONNECT_DB_USER=postgres
- COCONNECT_DB_PASSWORD=postgres
volumes:
- ./app/workers:/home/site/wwwroot
- ./app/shared:/shared
# Mount the local secret to Docker container
- ./app/workers/Secrets:/azure-functions-host/Secrets/
depends_on:
- web
- azurite
Expand Down

0 comments on commit 35fe75b

Please sign in to comment.