Merged PR 3: タスク 1327: DevOpsからRegistryにイメージをプッシュ
## 概要 [タスク 1327: DevOpsからRegistryにイメージをプッシュ](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/OMDSDictation/_workitems/edit/1327) - AzureDevOpsでデプロイするためにDockerFile等の構成を修正しました。 ## レビューポイント - 情報共有 - コンテナの構成として認識違い、不自然な点はないか ## UIの変更 - なし ## 動作確認状況 - イメージをビルドしてプッシュできることを確認
This commit is contained in:
parent
e686db674f
commit
0fa3b0eff8
29
DockerfileServerDictation.dockerfile
Normal file
29
DockerfileServerDictation.dockerfile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
FROM node:18.13.0-buster AS build-container
|
||||||
|
WORKDIR /app
|
||||||
|
RUN mkdir dictation_client \
|
||||||
|
&& mkdir dictation_server
|
||||||
|
COPY dictation_client/ dictation_client/
|
||||||
|
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 \
|
||||||
|
&& 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/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/
|
||||||
|
CMD ["node", "./dist/main.js" ]
|
||||||
29
DockerfileServerLicense.dockerfile
Normal file
29
DockerfileServerLicense.dockerfile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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" ]
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const SamplePage: React.FC = () => {
|
const SamplePage: React.FC = () => {
|
||||||
return (<div>hello whorld</div>)
|
return (<div>hello whorld!<br />Dictation App Service Site</div>)
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SamplePage;
|
export default SamplePage;
|
||||||
|
|||||||
@ -15,20 +15,20 @@ import { LoggerMiddleware } from './common/loggerMiddleware';
|
|||||||
envFilePath: ['.env.local', '.env'],
|
envFilePath: ['.env.local', '.env'],
|
||||||
isGlobal: true,
|
isGlobal: true,
|
||||||
}),
|
}),
|
||||||
TypeOrmModule.forRootAsync({
|
// TypeOrmModule.forRootAsync({
|
||||||
imports: [ConfigModule],
|
// imports: [ConfigModule],
|
||||||
useFactory: async (configService: ConfigService) => ({
|
// useFactory: async (configService: ConfigService) => ({
|
||||||
type: 'mysql',
|
// type: 'mysql',
|
||||||
host: configService.get('DB_ENDPOINT'),
|
// host: configService.get('DB_ENDPOINT'),
|
||||||
port: configService.get('DB_PORT'),
|
// port: configService.get('DB_PORT'),
|
||||||
username: configService.get('DB_USERNAME'),
|
// username: configService.get('DB_USERNAME'),
|
||||||
password: configService.get('DB_PASSWORD'),
|
// password: configService.get('DB_PASSWORD'),
|
||||||
database: configService.get('DB_NAME'),
|
// database: configService.get('DB_NAME'),
|
||||||
autoLoadEntities: true, // forFeature()で登録されたEntityを自動的にロード
|
// autoLoadEntities: true, // forFeature()で登録されたEntityを自動的にロード
|
||||||
synchronize: false, // trueにすると自動的にmigrationが行われるため注意
|
// synchronize: false, // trueにすると自動的にmigrationが行われるため注意
|
||||||
}),
|
// }),
|
||||||
inject: [ConfigService],
|
// inject: [ConfigService],
|
||||||
}),
|
// }),
|
||||||
],
|
],
|
||||||
controllers: [HealthController],
|
controllers: [HealthController],
|
||||||
providers: [],
|
providers: [],
|
||||||
|
|||||||
@ -6,6 +6,6 @@ export class HealthController {
|
|||||||
@Get()
|
@Get()
|
||||||
@ApiOperation({ operationId: 'checkHealth' })
|
@ApiOperation({ operationId: 'checkHealth' })
|
||||||
checkHealth(): string {
|
checkHealth(): string {
|
||||||
return 'OK';
|
return 'ODMS Dictation App Service Health OK';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,8 @@ async function bootstrap() {
|
|||||||
const document = SwaggerModule.createDocument(app, options);
|
const document = SwaggerModule.createDocument(app, options);
|
||||||
SwaggerModule.setup('api', app, document);
|
SwaggerModule.setup('api', app, document);
|
||||||
|
|
||||||
console.log(process.env.PORT);
|
// TODO:検証のためポートを固定 後で直す
|
||||||
|
// await app.listen(process.env.PORT || 80);
|
||||||
await app.listen(process.env.PORT || 80);
|
await app.listen(80);
|
||||||
}
|
}
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
|||||||
@ -15,20 +15,20 @@ import { LoggerMiddleware } from './common/loggerMiddleware';
|
|||||||
envFilePath: ['.env.local', '.env'],
|
envFilePath: ['.env.local', '.env'],
|
||||||
isGlobal: true,
|
isGlobal: true,
|
||||||
}),
|
}),
|
||||||
TypeOrmModule.forRootAsync({
|
// TypeOrmModule.forRootAsync({
|
||||||
imports: [ConfigModule],
|
// imports: [ConfigModule],
|
||||||
useFactory: async (configService: ConfigService) => ({
|
// useFactory: async (configService: ConfigService) => ({
|
||||||
type: 'mysql',
|
// type: 'mysql',
|
||||||
host: configService.get('DB_ENDPOINT'),
|
// host: configService.get('DB_ENDPOINT'),
|
||||||
port: configService.get('DB_PORT'),
|
// port: configService.get('DB_PORT'),
|
||||||
username: configService.get('DB_USERNAME'),
|
// username: configService.get('DB_USERNAME'),
|
||||||
password: configService.get('DB_PASSWORD'),
|
// password: configService.get('DB_PASSWORD'),
|
||||||
database: configService.get('DB_NAME'),
|
// database: configService.get('DB_NAME'),
|
||||||
autoLoadEntities: true, // forFeature()で登録されたEntityを自動的にロード
|
// autoLoadEntities: true, // forFeature()で登録されたEntityを自動的にロード
|
||||||
synchronize: false, // trueにすると自動的にmigrationが行われるため注意
|
// synchronize: false, // trueにすると自動的にmigrationが行われるため注意
|
||||||
}),
|
// }),
|
||||||
inject: [ConfigService],
|
// inject: [ConfigService],
|
||||||
}),
|
// }),
|
||||||
],
|
],
|
||||||
controllers: [HealthController],
|
controllers: [HealthController],
|
||||||
providers: [],
|
providers: [],
|
||||||
|
|||||||
@ -26,8 +26,6 @@ async function bootstrap() {
|
|||||||
const document = SwaggerModule.createDocument(app, options);
|
const document = SwaggerModule.createDocument(app, options);
|
||||||
SwaggerModule.setup('api', app, document);
|
SwaggerModule.setup('api', app, document);
|
||||||
|
|
||||||
console.log(process.env.PORT);
|
await app.listen(80);
|
||||||
|
|
||||||
await app.listen(process.env.PORT || 80);
|
|
||||||
}
|
}
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user