s1
This commit is contained in:
@@ -51,18 +51,23 @@ func generateImageName(repo *model.Repo) string {
|
||||
func GetDockerfileContent(repoType model.RepoType) string {
|
||||
switch repoType {
|
||||
case model.TypeNodeJS:
|
||||
return `FROM node:18-alpine
|
||||
return `FROM node:18-alpine as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
EXPOSE 3000
|
||||
FROM nginx:alpine
|
||||
|
||||
CMD ["npm", "start"]`
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]`
|
||||
|
||||
case model.TypePython:
|
||||
return `FROM python:3.11-slim
|
||||
|
||||
Reference in New Issue
Block a user