Revert "Revert "Merged PR 282: エラーの挙動について確認する""

This reverts commit 6ad3a81e0823923dd084e8becc59ad2398fca19c.
This commit is contained in:
x.yumoto.k 2023-07-31 16:07:34 +09:00
parent c8ecc32b80
commit 5fccc37dee
3 changed files with 11 additions and 39 deletions

View File

@ -1,14 +1,9 @@
FROM node:18.13.0-buster AS build-container
WORKDIR /app
RUN mkdir dictation_client \
&& mkdir dictation_server
COPY dictation_client/ dictation_client/
RUN mkdir dictation_server
COPY dictation_server/ dictation_server/
RUN npm install --force -g n && n 18.13.0 \
&& cd dictation_client \
&& npm ci \
&& npm run build \
&& cd ../dictation_server \
&& cd dictation_server \
&& npm ci \
&& npm run build \
&& cd ..
@ -22,7 +17,6 @@ WORKDIR /app
RUN mkdir build \
&& mkdir dist \
&& mkdir node_modules
COPY --from=build-container app/dictation_client/build/ build/
COPY --from=build-container app/dictation_server/dist/ dist/
COPY --from=build-container app/dictation_server/.env ./
COPY --from=build-container app/dictation_server/node_modules/ node_modules/

View File

@ -1,29 +0,0 @@
FROM node:18.13.0-buster AS build-container
WORKDIR /app
RUN mkdir license_client \
&& mkdir license_server
COPY license_client/ license_client/
COPY license_server/ license_server/
RUN npm install --force -g n && n 18.13.0 \
&& cd license_client \
&& npm ci \
&& npm run build \
&& cd ../license_server \
&& npm ci \
&& npm run build \
&& cd ..
FROM node:18.13.0-alpine
RUN apk --no-cache add tzdata \
&& cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \
&& apk del tzdata \
&& rm -rf /var/cache/apk/*
WORKDIR /app
RUN mkdir build \
&& mkdir dist \
&& mkdir node_modules
COPY --from=build-container app/license_client/build/ build/
COPY --from=build-container app/license_server/dist/ dist/
COPY --from=build-container app/license_server/.env ./
COPY --from=build-container app/license_server/node_modules/ node_modules/
CMD ["node", "./dist/main.js" ]

View File

@ -43,8 +43,15 @@ import { TemplateFilesRepositoryModule } from './repositories/template_files/tem
@Module({
imports: [
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'build'),
ServeStaticModule.forRootAsync({
useFactory: () =>
process.env.STAGE === 'local'
? [
{
rootPath: join(__dirname, '..', 'build'),
},
]
: [],
}),
ConfigModule.forRoot({
envFilePath: ['.env.local', '.env'],