From 4f00ef6ae4cee21b39fdbb869339f1cbc24044b3 Mon Sep 17 00:00:00 2001 From: mifi Date: Thu, 25 May 2023 12:06:44 -0400 Subject: [PATCH] Finishing touches? --- .gitignore | 2 +- Dockerfile | 8 ++++---- docker-compose.dev.yml | 4 ++-- docker-compose.staging-build.yml | 4 ++-- tsconfig.json | 2 +- tsconfig.production.json | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index e059d99..e5eb434 100644 --- a/.gitignore +++ b/.gitignore @@ -132,4 +132,4 @@ dist # Project lib/ - +dist/ diff --git a/Dockerfile b/Dockerfile index 1195c05..ad0a6eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,10 @@ ENV NODE_ENV development ENV NPM_TOKEN $NPM_TOKEN WORKDIR /home/node/app COPY .npmrc /root -COPY .yarnrc.build.yml /root/.yarnrc.yml -COPY lib package*.json tsconfig.json yarn.lock ./ +COPY .build.yarnrc.yml /root/.yarnrc.yml +COPY . . RUN yarn set version stable && yarn install -RUN yarn build +RUN yarn build:production ## this is stage two , where the app actually runs FROM node:20-bullseye-slim AS containerize @@ -30,6 +30,6 @@ COPY .npmrc /root COPY .build.yarnrc.yml /root/.yarnrc.yml COPY package*.json yarn.lock ./ RUN yarn set version stable && yarn install && yarn cache clean -COPY --from=build /home/node/app/dist . +COPY --from=build /home/node/app/dist ./ EXPOSE $PORT CMD ["node","index.js"] diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 6812f22..2806a90 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -17,7 +17,7 @@ services: - auth-db:/data/db - auth-db:/data/configdb restart: unless-stopped - image: mongo:latest + image: ${CONTAINER_PREFIX}-auth-service_mongo:${TAG:-latest} auth-service: env_file: .env.dev build: @@ -37,7 +37,7 @@ services: - labs-net - backend restart: unless-stopped - image: node:20-alpine + image: ${CONTAINER_PREFIX}-auth-service:${TAG:-latest} depends_on: - auth-service_mongo networks: diff --git a/docker-compose.staging-build.yml b/docker-compose.staging-build.yml index a6620f1..6c2ec81 100644 --- a/docker-compose.staging-build.yml +++ b/docker-compose.staging-build.yml @@ -16,7 +16,7 @@ services: - 'auth-db:/data/db' - 'auth-db:/data/configdb' restart: unless-stopped - image: mongo:4.4 + image: ${CONTAINER_PREFIX}auth-service_mongo:${DRONE_TAG:-latest} auth-service: container_name: ${CONTAINER_PREFIX}-auth-service env_file: @@ -42,7 +42,7 @@ services: - auth-backend - docknet restart: unless-stopped - image: node:20-alpine + image: ${CONTAINER_PREFIX}auth-service:${DRONE_TAG:-latest} depends_on: - auth-service_mongo networks: diff --git a/tsconfig.json b/tsconfig.json index 422e4f8..a75d74a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "experimentalDecorators": true, "emitDecoratorMetadata": true, "noImplicitAny": true, - "outDir": "lib/", + "outDir": "dist/", "rootDirs": ["./", "src/"], "strict": true, "esModuleInterop": true, diff --git a/tsconfig.production.json b/tsconfig.production.json index 48f8fba..034fad6 100644 --- a/tsconfig.production.json +++ b/tsconfig.production.json @@ -6,12 +6,12 @@ "experimentalDecorators": true, "emitDecoratorMetadata": true, "noImplicitAny": true, - "outDir": "lib/", + "outDir": "dist/", "rootDirs": ["./", "src/"], "strict": true, "esModuleInterop": true, "sourceMap": false, "removeComments": true }, - "include": ["src"] + "include": ["./src"] }