fix(databasemodule): make ssl optional, pass ca cert as base64 env
This commit is contained in:
parent
cff51a8be9
commit
c738f311da
|
@ -13,11 +13,17 @@ jobs:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v3.0.0
|
uses: actions/checkout@v3.0.0
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to DigitalOcean Container Registry
|
||||||
uses: docker/login-action@v1.14.1
|
uses: docker/login-action@v1.14.1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
registry: registry.digitalocean.com
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
username: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
||||||
|
password: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
||||||
|
|
||||||
|
- name: Copy Environment Variable Configuration
|
||||||
|
run: echo $ENV_FILE | base64 --decode > .env
|
||||||
|
env:
|
||||||
|
ENV_FILE: ${{ secrets.ENV_FILE }}
|
||||||
|
|
||||||
- name: Build and Push Server Docker Image
|
- name: Build and Push Server Docker Image
|
||||||
uses: docker/build-push-action@v2.9.0
|
uses: docker/build-push-action@v2.9.0
|
||||||
|
@ -25,7 +31,7 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
file: server/Dockerfile
|
file: server/Dockerfile
|
||||||
tags: amruthpillai/reactive-resume:server-latest
|
tags: registry.digitalocean.com/reactive-resume/server:latest
|
||||||
|
|
||||||
- name: Build and Push Client Docker Image
|
- name: Build and Push Client Docker Image
|
||||||
uses: docker/build-push-action@v2.9.0
|
uses: docker/build-push-action@v2.9.0
|
||||||
|
@ -33,4 +39,4 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
file: client/Dockerfile
|
file: client/Dockerfile
|
||||||
tags: amruthpillai/reactive-resume:client-latest
|
tags: registry.digitalocean.com/reactive-resume/client:latest
|
||||||
|
|
|
@ -24,7 +24,7 @@ COPY --from=dependencies /app/node_modules ./node_modules
|
||||||
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
|
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
|
||||||
COPY --from=dependencies /app/client/node_modules ./client/node_modules
|
COPY --from=dependencies /app/client/node_modules ./client/node_modules
|
||||||
|
|
||||||
RUN cp .env ./client/.env
|
RUN [[ -e .env ]] && cp .env ./client/.env
|
||||||
|
|
||||||
RUN pnpm run build:schema
|
RUN pnpm run build:schema
|
||||||
RUN pnpm run build:client
|
RUN pnpm run build:client
|
||||||
|
|
|
@ -24,7 +24,7 @@ COPY --from=dependencies /app/node_modules ./node_modules
|
||||||
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
|
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
|
||||||
COPY --from=dependencies /app/server/node_modules ./server/node_modules
|
COPY --from=dependencies /app/server/node_modules ./server/node_modules
|
||||||
|
|
||||||
RUN cp .env ./server/.env
|
RUN [[ -e .env ]] && cp .env ./server/.env
|
||||||
|
|
||||||
RUN pnpm run build:schema
|
RUN pnpm run build:schema
|
||||||
RUN pnpm run build:server
|
RUN pnpm run build:server
|
||||||
|
|
|
@ -19,6 +19,9 @@ import { User } from '@/users/entities/user.entity';
|
||||||
database: configService.get<string>('postgres.database'),
|
database: configService.get<string>('postgres.database'),
|
||||||
synchronize: true,
|
synchronize: true,
|
||||||
entities: [User, Resume],
|
entities: [User, Resume],
|
||||||
|
ssl: configService.get<string>('postgres.certificate') && {
|
||||||
|
ca: Buffer.from(configService.get<string>('postgres.certificate'), 'base64').toString('ascii'),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue