This commit is contained in:
Kar
2026-02-01 20:38:58 +05:30
parent 52265ed4cc
commit 5e563fb436
11 changed files with 159 additions and 51 deletions

View File

@@ -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