-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
17 deletions.
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,26 @@ | ||
# Schema Service | ||
SCHEMA_BASE_URL=https://example.com/schema-service | ||
|
||
# Credential Service | ||
CREDENTIAL_BASE_URL=https://example.com/credential-service | ||
C4GT_DID=did:example:123456789abcdefghi | ||
DEFAULT_CERTIFICATE_LIFETIME=31536000 | ||
|
||
# Identity Service | ||
IDENTITY_BASE_URL=url | ||
|
||
# Certificates Verification | ||
VERIFICATION_BASE_URL=https://example.com/verification-service | ||
|
||
# MinIO Configuration | ||
MINIO_USERNAME=your-minio-username | ||
MINIO_PASSWORD=your-minio-password | ||
MINIO_BUCKETNAME=your-bucket-name | ||
MINIO_PORT=9000 | ||
MINIO_ENDPOINT=minioadminpassword | ||
MINIO_SECRET_KEY=your-minio-secret-key | ||
MINIO_ACCESS_KEY=minioadmin | ||
MINIO_USE_SSL=true | ||
|
||
# DB Config | ||
C4GT_BFF_POSTGRES_BASE_URL=postgresql://postgres:password@localhost:5432/c4gtbff?schema=public |
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 |
---|---|---|
@@ -1,18 +1,39 @@ | ||
FROM node:16 | ||
# FROM --platform=linux/amd64 node:18-slim | ||
# Stage 1: Build | ||
FROM --platform=linux/amd64 node:18 AS builder | ||
|
||
WORKDIR /app | ||
|
||
# Install dependencies and build the application | ||
COPY package.json ./ | ||
COPY yarn.lock ./ | ||
COPY prisma ./prisma/ | ||
|
||
RUN yarn | ||
COPY . . | ||
RUN yarn run build | ||
|
||
# Stage 2: Runtime | ||
FROM --platform=linux/amd64 node:18 AS runtime | ||
|
||
WORKDIR /app | ||
|
||
# Install required runtime dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y wget gnupg \ | ||
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | ||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | ||
&& apt-get update \ | ||
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ | ||
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 ghostscript \ | ||
--no-install-recommends \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get install ghostscript=10.02.0 | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy necessary files from the builder stage | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./ | ||
COPY --from=builder /app/yarn.lock ./ | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/prisma ./prisma | ||
COPY --from=builder /app/tsconfig.json ./ | ||
|
||
WORKDIR /app | ||
COPY . ./ | ||
RUN yarn | ||
EXPOSE 3001 | ||
CMD ["yarn", "start"] | ||
CMD ["yarn", "start:prod"] |
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 |
---|---|---|
@@ -1,9 +1,60 @@ | ||
version: '3' | ||
version: '3.8' | ||
|
||
services: | ||
c4gt-bff: | ||
image: c4gt-bff | ||
build: https://github.com/techsavvyash/c4gt-bff.git | ||
env_file: .env | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: c4gt-bff | ||
ports: | ||
- '${SERVICE_PUBLIC_PORT}:3001' | ||
- "3001:3001" | ||
environment: | ||
SCHEMA_BASE_URL: https://example.com/schema-service | ||
CREDENTIAL_BASE_URL: https://example.com/credential-service | ||
C4GT_DID: did:example:123456789abcdefghi | ||
DEFAULT_CERTIFICATE_LIFETIME: 31536000 | ||
IDENTITY_BASE_URL: url | ||
VERIFICATION_BASE_URL: https://example.com/verification-service | ||
MINIO_USERNAME: your-minio-username | ||
MINIO_PASSWORD: your-minio-password | ||
MINIO_BUCKETNAME: your-bucket-name | ||
MINIO_PORT: 9000 | ||
MINIO_ENDPOINT: minioadminpassword | ||
MINIO_SECRET_KEY: your-minio-secret-key | ||
MINIO_ACCESS_KEY: minioadmin | ||
MINIO_USE_SSL: "true" | ||
C4GT_BFF_POSTGRES_BASE_URL: postgres://postgres:postgres@postgres:5432/c4gt-bff | ||
depends_on: | ||
- postgres | ||
- minio | ||
|
||
postgres: | ||
image: postgres:14 | ||
container_name: postgres | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: c4gt-bff | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
|
||
minio: | ||
image: minio/minio:latest | ||
container_name: minio | ||
environment: | ||
MINIO_ROOT_USER: minioadmin | ||
MINIO_ROOT_PASSWORD: minioadminpassword | ||
ports: | ||
- "9000:9000" # MinIO web access | ||
- "9001:9001" # MinIO console access | ||
command: server /data --console-address ":9001" | ||
volumes: | ||
- minio_data:/data | ||
|
||
volumes: | ||
postgres_data: | ||
driver: local | ||
minio_data: | ||
driver: local |
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