From 060f403f95a632ab957fe38e63496057e44768e7 Mon Sep 17 00:00:00 2001 From: Matt Schoch Date: Fri, 29 Mar 2024 17:11:22 -0400 Subject: [PATCH] adding dockerfile to test building Vault into docker --- .../module/persistence/schema/schema.prisma | 1 + docker-compose.yml | 18 +++++------------- vault.dockerfile | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 vault.dockerfile diff --git a/apps/vault/src/shared/module/persistence/schema/schema.prisma b/apps/vault/src/shared/module/persistence/schema/schema.prisma index 332237bf8..234ee405e 100644 --- a/apps/vault/src/shared/module/persistence/schema/schema.prisma +++ b/apps/vault/src/shared/module/persistence/schema/schema.prisma @@ -1,5 +1,6 @@ generator client { provider = "prisma-client-js" + binaryTargets = ["native", "debian-openssl-3.0.x"] // Output into a separate subdirectory so multiple schemas can be used in a // monorepo. // diff --git a/docker-compose.yml b/docker-compose.yml index 7ff0d869f..0b25d30e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,20 +10,12 @@ services: - '5432:5432' volumes: - postgres_data:/var/lib/postgresql/data - redis: - image: 'bitnami/redis:7.0' + vault: + build: + context: . + dockerfile: vault.dockerfile ports: - - '6379:6379' - expose: - - '6379' - environment: - ALLOW_EMPTY_PASSWORD: 'true' - logging: - driver: none - volumes: - - redis_data:/data + - '3011:3011' volumes: postgres_data: driver: local - redis_data: - driver: local diff --git a/vault.dockerfile b/vault.dockerfile new file mode 100644 index 000000000..3dedbfe29 --- /dev/null +++ b/vault.dockerfile @@ -0,0 +1,19 @@ +FROM node:21 + +# Set the working directory +WORKDIR /usr/src/app + +COPY package*.json ./ + +# Copy the local code to the container's workspace. +COPY . . + +RUN npm install +RUN make vault/db/generate-types +RUN make vault/build/script + +COPY apps/vault/.env .env + +EXPOSE 3011 + +CMD npx dotenv -e apps/vault/.env -- node dist/apps/vault/main.js