Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/kotlin/com/dcd/server/core/common/file/FileContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ object FileContent {
private fun getNestJsDockerFileContent(version: String, port: Int, env: Map<String, String>, initialScripts: List<String>): String =
"""
FROM node:${version}
COPY . .
RUN npm install
RUN npm run build
EXPOSE $port
${getEnvString(env)}
${getInitialScriptsString(initialScripts)}
CMD ["npm", "start"]
COPY package*.json ./
COPY dist ./dist
RUN npm ci --production=true
EXPOSE $port
CMD ["sh", "-c", "TZ=Asia/Seoul node dist/main.js"]
""".trimIndent()

private fun getMYSQLDockerFileContent(version: String, port: Int, env: Map<String, String>, initialScripts: List<String>): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class BuildDockerImageServiceImpl(
commandPort.executeShellCommand("cd ./$directoryName && ./gradlew clean build")
commandPort.executeShellCommand("cd ./$directoryName && docker build -t ${application.containerName}:latest .")
}
ApplicationType.NEST_JS -> {
commandPort.executeShellCommand("cd ./$directoryName && npm run build && docker build -t ${application.containerName}:latest .")
}
else -> {
commandPort.executeShellCommand("cd ./$directoryName && docker build -t ${application.containerName}:latest .")
}
Expand Down