Skip to content

Commit ac79579

Browse files
forms for vue / react / angular
1 parent 4dd14d5 commit ac79579

File tree

10,179 files changed

+283
-2362345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,179 files changed

+283
-2362345
lines changed

Diff for: src/dockerizers/angular/files.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Dockerfile.njk": "# Use official node image as the base image\nFROM {{ node_image }} as build\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install\nCOPY . .\nRUN npm run build\n\n# Use official nginx image as the base image\nFROM {{ nginx_image }}\nCOPY --from=build /app/dist/{{ project_name }}/browser /usr/share/nginx/html\nEXPOSE {{ port }}\nCMD [\"nginx\", \"-g\", \"daemon off;\"]"
3+
}

Diff for: src/dockerizers/angular/files/Dockerfile

-24
This file was deleted.

Diff for: src/dockerizers/angular/files/Dockerfile.njk

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Use official node image as the base image
2+
FROM {{ node_image }} as build
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm install
6+
COPY . .
7+
RUN npm run build
8+
9+
# Use official nginx image as the base image
10+
FROM {{ nginx_image }}
11+
COPY --from=build /app/dist/{{ project_name }}/browser /usr/share/nginx/html
12+
EXPOSE {{ port }}
13+
CMD ["nginx", "-g", "daemon off;"]

Diff for: src/dockerizers/angular/index.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Files } from "@/lib/types";
2+
import { renderString } from "nunjucks";
3+
import { z } from "zod";
4+
import files from "./files.json";
5+
6+
export const schema = z.object({
7+
project_name: z.string().default("myApp"),
8+
node_image: z.string().default("node:18-alpine"),
9+
nginx_image: z.string().default("nginx:stable"),
10+
port: z.string().default("80"),
11+
});
12+
13+
export const defaultValues = schema.parse({});
14+
15+
export function generate(rawInput: z.infer<typeof schema>): Files {
16+
const input = schema.parse(rawInput);
17+
return {
18+
Dockerfile: renderString(files["Dockerfile.njk"], input),
19+
};
20+
}

Diff for: src/dockerizers/react/files.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Dockerfile.njk": "# build stage\nFROM {{ node_image }} as build\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install\nCOPY . .\nRUN npm run build\n\n# production stage\nFROM {{ nginx_image }} as production\nCOPY --from=build /app/dist /usr/share/nginx/html\nEXPOSE {{ port }}\nCMD [\"nginx\", \"-g\", \"daemon off;\"]"
3+
}

Diff for: src/dockerizers/react/files/Dockerfile.njk

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# build stage
2-
FROM node:lts-alpine as build
2+
FROM {{ node_image }} as build
33
WORKDIR /app
44
COPY package*.json ./
55
RUN npm install
66
COPY . .
77
RUN npm run build
88

99
# production stage
10-
FROM nginx:stable-alpine as production
11-
COPY --from=build-stage /app/dist /usr/share/nginx/html
12-
EXPOSE 80
10+
FROM {{ nginx_image }} as production
11+
COPY --from=build /app/dist /usr/share/nginx/html
12+
EXPOSE {{ port }}
1313
CMD ["nginx", "-g", "daemon off;"]

Diff for: src/dockerizers/react/index.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Files } from "@/lib/types";
2+
import { renderString } from "nunjucks";
3+
import { z } from "zod";
4+
import files from "./files.json";
5+
6+
export const schema = z.object({
7+
node_image: z.string().default("node:18-alpine"),
8+
nginx_image: z.string().default("nginx:stable"),
9+
port: z.string().default("80"),
10+
});
11+
12+
export const defaultValues = schema.parse({});
13+
14+
export function generate(rawInput: z.infer<typeof schema>): Files {
15+
const input = schema.parse(rawInput);
16+
return {
17+
Dockerfile: renderString(files["Dockerfile.njk"], input),
18+
};
19+
}

Diff for: src/dockerizers/vuejs copy/tests/default/code/node_modules/@eslint-community/eslint-utils/LICENSE

-21
This file was deleted.

Diff for: src/dockerizers/vuejs copy/tests/default/code/node_modules/@eslint-community/eslint-utils/README.md

-37
This file was deleted.

0 commit comments

Comments
 (0)