├── .gitignore ├── README.md ├── components.json ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico ├── next.svg └── vercel.svg ├── src ├── components │ ├── Layout.tsx │ ├── SimpleTooltip.tsx │ └── ui │ │ ├── button.tsx │ │ ├── checkbox.tsx │ │ ├── collapsible.tsx │ │ ├── dropdown-menu.tsx │ │ ├── form-fields.tsx │ │ ├── form.tsx │ │ ├── input.tsx │ │ ├── label.tsx │ │ ├── mode-toggle.tsx │ │ ├── scroll-area.tsx │ │ ├── select.tsx │ │ ├── sonner.tsx │ │ ├── switch.tsx │ │ ├── tabs.tsx │ │ └── tooltip.tsx ├── dockerizers │ ├── angular │ │ ├── files.json │ │ ├── files │ │ │ ├── Dockerfile.njk │ │ │ └── nginx.conf │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── .vscode │ │ │ │ ├── extensions.json │ │ │ │ ├── launch.json │ │ │ │ └── tasks.json │ │ │ ├── README.md │ │ │ ├── angular.json │ │ │ ├── dockerizer │ │ │ │ ├── Dockerfile │ │ │ │ └── nginx.conf │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── server.ts │ │ │ ├── src │ │ │ │ ├── app │ │ │ │ │ ├── app.component.css │ │ │ │ │ ├── app.component.html │ │ │ │ │ ├── app.component.spec.ts │ │ │ │ │ ├── app.component.ts │ │ │ │ │ ├── app.config.server.ts │ │ │ │ │ ├── app.config.ts │ │ │ │ │ └── app.routes.ts │ │ │ │ ├── assets │ │ │ │ │ └── .gitkeep │ │ │ │ ├── favicon.ico │ │ │ │ ├── index.html │ │ │ │ ├── main.server.ts │ │ │ │ ├── main.ts │ │ │ │ └── styles.css │ │ │ ├── tsconfig.app.json │ │ │ ├── tsconfig.json │ │ │ └── tsconfig.spec.json │ │ │ └── input.json │ ├── nestjs │ │ ├── files.json │ │ ├── files │ │ │ └── Dockerfile.njk │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .eslintrc.js │ │ │ ├── .gitignore │ │ │ ├── .prettierrc │ │ │ ├── README.md │ │ │ ├── dockerizer │ │ │ │ └── Dockerfile │ │ │ ├── nest-cli.json │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ ├── app.controller.spec.ts │ │ │ │ ├── app.controller.ts │ │ │ │ ├── app.module.ts │ │ │ │ ├── app.service.ts │ │ │ │ └── main.ts │ │ │ ├── test │ │ │ │ ├── app.e2e-spec.ts │ │ │ │ └── jest-e2e.json │ │ │ ├── tsconfig.build.json │ │ │ └── tsconfig.json │ │ │ ├── input.json │ │ │ └── test.sh │ ├── nextjs │ │ ├── files.json │ │ ├── files │ │ │ └── Dockerfile.njk │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .eslintrc.json │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── dockerizer │ │ │ │ └── Dockerfile │ │ │ ├── next.config.js │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── postcss.config.js │ │ │ ├── public │ │ │ │ ├── favicon.ico │ │ │ │ ├── next.svg │ │ │ │ └── vercel.svg │ │ │ ├── src │ │ │ │ ├── pages │ │ │ │ │ ├── _app.tsx │ │ │ │ │ ├── _document.tsx │ │ │ │ │ ├── api │ │ │ │ │ │ └── hello.ts │ │ │ │ │ └── index.tsx │ │ │ │ └── styles │ │ │ │ │ └── globals.css │ │ │ ├── tailwind.config.ts │ │ │ └── tsconfig.json │ │ │ ├── input.json │ │ │ └── test.sh │ ├── nodejs │ │ ├── files.json │ │ ├── files │ │ │ └── Dockerfile.njk │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .gitignore │ │ │ ├── dockerizer │ │ │ │ └── Dockerfile │ │ │ ├── index.js │ │ │ ├── package-lock.json │ │ │ └── package.json │ │ │ ├── input.json │ │ │ └── test.sh │ ├── nuxtjs │ │ ├── files.json │ │ ├── files │ │ │ └── Dockerfile.njk │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── app.vue │ │ │ ├── dockerizer │ │ │ │ └── Dockerfile │ │ │ ├── nuxt.config.ts │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ ├── server │ │ │ │ └── tsconfig.json │ │ │ └── tsconfig.json │ │ │ ├── input.json │ │ │ └── test.sh │ ├── php │ │ ├── files.json │ │ ├── files │ │ │ ├── Dockerfile.njk │ │ │ ├── apache-vhost.conf.njk │ │ │ ├── nginx-vhost.conf.njk │ │ │ └── php.ini.njk │ │ ├── index.ts │ │ └── tests │ │ │ ├── apache │ │ │ ├── code │ │ │ │ ├── dockerizer │ │ │ │ │ ├── Dockerfile │ │ │ │ │ ├── php.ini │ │ │ │ │ └── vhost.conf │ │ │ │ └── index.php │ │ │ └── input.json │ │ │ ├── default │ │ │ ├── code │ │ │ │ ├── dockerizer │ │ │ │ │ ├── Dockerfile │ │ │ │ │ ├── php.ini │ │ │ │ │ └── vhost.conf │ │ │ │ └── index.php │ │ │ └── input.json │ │ │ ├── document-root │ │ │ ├── code │ │ │ │ ├── dockerizer │ │ │ │ │ ├── Dockerfile │ │ │ │ │ ├── php.ini │ │ │ │ │ └── vhost.conf │ │ │ │ └── public │ │ │ │ │ └── index.php │ │ │ └── input.json │ │ │ └── laravel │ │ │ ├── code │ │ │ ├── .editorconfig │ │ │ ├── .env.example │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── app │ │ │ │ ├── Console │ │ │ │ │ └── Kernel.php │ │ │ │ ├── Exceptions │ │ │ │ │ └── Handler.php │ │ │ │ ├── Http │ │ │ │ │ ├── Controllers │ │ │ │ │ │ └── Controller.php │ │ │ │ │ ├── Kernel.php │ │ │ │ │ └── Middleware │ │ │ │ │ │ ├── Authenticate.php │ │ │ │ │ │ ├── EncryptCookies.php │ │ │ │ │ │ ├── PreventRequestsDuringMaintenance.php │ │ │ │ │ │ ├── RedirectIfAuthenticated.php │ │ │ │ │ │ ├── TrimStrings.php │ │ │ │ │ │ ├── TrustHosts.php │ │ │ │ │ │ ├── TrustProxies.php │ │ │ │ │ │ ├── ValidateSignature.php │ │ │ │ │ │ └── VerifyCsrfToken.php │ │ │ │ ├── Models │ │ │ │ │ └── User.php │ │ │ │ └── Providers │ │ │ │ │ ├── AppServiceProvider.php │ │ │ │ │ ├── AuthServiceProvider.php │ │ │ │ │ ├── BroadcastServiceProvider.php │ │ │ │ │ ├── EventServiceProvider.php │ │ │ │ │ └── RouteServiceProvider.php │ │ │ ├── artisan │ │ │ ├── bootstrap │ │ │ │ ├── app.php │ │ │ │ └── cache │ │ │ │ │ └── .gitignore │ │ │ ├── composer.json │ │ │ ├── composer.lock │ │ │ ├── config │ │ │ │ ├── app.php │ │ │ │ ├── auth.php │ │ │ │ ├── broadcasting.php │ │ │ │ ├── cache.php │ │ │ │ ├── cors.php │ │ │ │ ├── database.php │ │ │ │ ├── filesystems.php │ │ │ │ ├── hashing.php │ │ │ │ ├── logging.php │ │ │ │ ├── mail.php │ │ │ │ ├── queue.php │ │ │ │ ├── sanctum.php │ │ │ │ ├── services.php │ │ │ │ ├── session.php │ │ │ │ └── view.php │ │ │ ├── database │ │ │ │ ├── .gitignore │ │ │ │ ├── factories │ │ │ │ │ └── UserFactory.php │ │ │ │ ├── migrations │ │ │ │ │ ├── 2014_10_12_000000_create_users_table.php │ │ │ │ │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php │ │ │ │ │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ │ │ │ │ └── 2019_12_14_000001_create_personal_access_tokens_table.php │ │ │ │ └── seeders │ │ │ │ │ └── DatabaseSeeder.php │ │ │ ├── dockerizer │ │ │ │ ├── Dockerfile │ │ │ │ ├── php.ini │ │ │ │ └── vhost.conf │ │ │ ├── package.json │ │ │ ├── phpunit.xml │ │ │ ├── public │ │ │ │ ├── .htaccess │ │ │ │ ├── favicon.ico │ │ │ │ ├── index.php │ │ │ │ └── robots.txt │ │ │ ├── resources │ │ │ │ ├── css │ │ │ │ │ └── app.css │ │ │ │ ├── js │ │ │ │ │ ├── app.js │ │ │ │ │ └── bootstrap.js │ │ │ │ └── views │ │ │ │ │ └── welcome.blade.php │ │ │ ├── routes │ │ │ │ ├── api.php │ │ │ │ ├── channels.php │ │ │ │ ├── console.php │ │ │ │ └── web.php │ │ │ ├── storage │ │ │ │ ├── app │ │ │ │ │ ├── .gitignore │ │ │ │ │ └── public │ │ │ │ │ │ └── .gitignore │ │ │ │ ├── framework │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── cache │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ └── data │ │ │ │ │ │ │ └── .gitignore │ │ │ │ │ ├── sessions │ │ │ │ │ │ └── .gitignore │ │ │ │ │ ├── testing │ │ │ │ │ │ └── .gitignore │ │ │ │ │ └── views │ │ │ │ │ │ └── .gitignore │ │ │ │ └── logs │ │ │ │ │ └── .gitignore │ │ │ ├── tests │ │ │ │ ├── CreatesApplication.php │ │ │ │ ├── Feature │ │ │ │ │ └── ExampleTest.php │ │ │ │ ├── TestCase.php │ │ │ │ └── Unit │ │ │ │ │ └── ExampleTest.php │ │ │ └── vite.config.js │ │ │ └── input.json │ ├── react │ │ ├── files.json │ │ ├── files │ │ │ ├── Dockerfile.njk │ │ │ └── nginx.conf │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .eslintrc.cjs │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── dockerizer │ │ │ │ ├── Dockerfile │ │ │ │ └── nginx.conf │ │ │ ├── index.html │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ └── vite.svg │ │ │ ├── src │ │ │ │ ├── App.css │ │ │ │ ├── App.tsx │ │ │ │ ├── assets │ │ │ │ │ └── react.svg │ │ │ │ ├── index.css │ │ │ │ ├── main.tsx │ │ │ │ └── vite-env.d.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.node.json │ │ │ └── vite.config.ts │ │ │ └── input.json │ ├── sample │ │ ├── files.json │ │ ├── files │ │ │ └── Dockerfile.njk │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ └── dockerizer │ │ │ │ └── Dockerfile │ │ │ └── input.json │ ├── strapi │ │ ├── files.json │ │ ├── files │ │ │ └── Dockerfile.njk │ │ ├── index.ts │ │ └── tests │ │ │ └── default │ │ │ ├── code │ │ │ ├── .editorconfig │ │ │ ├── .env.example │ │ │ ├── .eslintignore │ │ │ ├── .eslintrc │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── config │ │ │ │ ├── admin.js │ │ │ │ ├── api.js │ │ │ │ ├── database.js │ │ │ │ ├── middlewares.js │ │ │ │ └── server.js │ │ │ ├── database │ │ │ │ └── migrations │ │ │ │ │ └── .gitkeep │ │ │ ├── dockerizer │ │ │ │ └── Dockerfile │ │ │ ├── favicon.png │ │ │ ├── jsconfig.json │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ ├── robots.txt │ │ │ │ └── uploads │ │ │ │ │ └── .gitkeep │ │ │ ├── src │ │ │ │ ├── admin │ │ │ │ │ ├── app.example.js │ │ │ │ │ └── webpack.config.example.js │ │ │ │ ├── api │ │ │ │ │ └── .gitkeep │ │ │ │ ├── extensions │ │ │ │ │ └── .gitkeep │ │ │ │ └── index.js │ │ │ └── yarn.lock │ │ │ ├── input.json │ │ │ └── test.sh │ └── vuejs │ │ ├── files.json │ │ ├── files │ │ ├── Dockerfile.njk │ │ └── nginx.conf │ │ ├── index.ts │ │ └── tests │ │ └── default │ │ ├── code │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── .prettierrc.json │ │ ├── .vscode │ │ │ └── extensions.json │ │ ├── README.md │ │ ├── dockerizer │ │ │ ├── Dockerfile │ │ │ └── nginx.conf │ │ ├── env.d.ts │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.ico │ │ ├── src │ │ │ ├── App.vue │ │ │ ├── assets │ │ │ │ ├── base.css │ │ │ │ ├── logo.svg │ │ │ │ └── main.css │ │ │ ├── components │ │ │ │ ├── HelloWorld.vue │ │ │ │ ├── TheWelcome.vue │ │ │ │ ├── WelcomeItem.vue │ │ │ │ ├── __tests__ │ │ │ │ │ └── HelloWorld.spec.ts │ │ │ │ └── icons │ │ │ │ │ ├── IconCommunity.vue │ │ │ │ │ ├── IconDocumentation.vue │ │ │ │ │ ├── IconEcosystem.vue │ │ │ │ │ ├── IconSupport.vue │ │ │ │ │ └── IconTooling.vue │ │ │ ├── main.ts │ │ │ ├── router │ │ │ │ └── index.ts │ │ │ ├── stores │ │ │ │ └── counter.ts │ │ │ └── views │ │ │ │ ├── AboutView.vue │ │ │ │ └── HomeView.vue │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ ├── tsconfig.vitest.json │ │ ├── vite.config.ts │ │ └── vitest.config.ts │ │ ├── input.json │ │ └── test.sh ├── lib │ ├── download.ts │ ├── highlight.ts │ ├── types.ts │ └── utils.ts ├── pages │ ├── _app.tsx │ ├── _document.tsx │ ├── angular │ │ └── index.tsx │ ├── express │ │ └── index.tsx │ ├── index.tsx │ ├── laravel │ │ └── index.tsx │ ├── nestjs │ │ └── index.tsx │ ├── nextjs │ │ └── index.tsx │ ├── nodejs │ │ └── index.tsx │ ├── nuxtjs │ │ └── index.tsx │ ├── php │ │ └── index.tsx │ ├── react │ │ └── index.tsx │ ├── strapi │ │ └── index.tsx │ └── vuejs │ │ └── index.tsx ├── scripts │ ├── compile-files.ts │ ├── compile-tests.ts │ └── hadolint.ts └── styles │ └── globals.css ├── tailwind.config.js ├── tailwind.config.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | /dist/ 16 | 17 | # production 18 | /build 19 | 20 | # misc 21 | .DS_Store 22 | *.pem 23 | 24 | # debug 25 | npm-debug.log* 26 | yarn-debug.log* 27 | yarn-error.log* 28 | 29 | # local env files 30 | .env*.local 31 | 32 | # vercel 33 | .vercel 34 | 35 | # typescript 36 | *.tsbuildinfo 37 | next-env.d.ts 38 | 39 | todo 40 | 41 | # **/code/dockerizer -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerizer 2 | 3 | > Provided by [Easypanel](https://easypanel.io) 4 | 5 | ## Codebase Structure 6 | 7 | Each Dockerizer has its own folder: `src/dockerizers/[name]` 8 | 9 | ``` 10 | index.ts # dockerizer schema & generation logic 11 | 12 | files/ # files, templates, config files 13 | files.json # compiled from the files folder 14 | 15 | tests/ 16 | [test-name]/ 17 | code/ # test application codebase 18 | input.json # test input for the dockerizer 19 | ``` 20 | 21 | You can get started by copying the `sample` dockerizer. 22 | 23 | On the UI, there is a one or more pages for each Dockerizer. Those live in `src/pages/[name]` 24 | 25 | ## Development 26 | 27 | Run `npm run dev` to start the Next.js application. 28 | 29 | ## Scripts 30 | 31 | - `npm run compile-files` - compiles all the files from a dockerizer to `files.json` 32 | - `npm run compile-files-watch` - watches for changes and run `compile-files` automatically 33 | - `npm run compile-tests` - generates the `dockerizer` folder for each test app based on `input.json` 34 | - `npm run hadolint` - lints all Dockerfiles (make sure you run `compile-tests` before this) 35 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": false, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.js", 8 | "css": "src/styles/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | output: "export", 4 | distDir: "dist", 5 | basePath: process.env.NODE_ENV === "production" ? "/dockerizer" : undefined, 6 | trailingSlash: true, 7 | skipTrailingSlashRedirect: true, 8 | images: { unoptimized: true }, 9 | reactStrictMode: true, 10 | }; 11 | 12 | const withBundleAnalyzer = require("@next/bundle-analyzer")({ 13 | enabled: process.env.ANALYZE === "true", 14 | }); 15 | 16 | module.exports = withBundleAnalyzer(nextConfig); 17 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/public/favicon.ico -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/SimpleTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Tooltip, 3 | TooltipContent, 4 | TooltipTrigger, 5 | } from "@/components/ui/tooltip"; 6 | import { ReactNode } from "react"; 7 | 8 | export function SimpleTooltip({ 9 | children, 10 | content, 11 | }: { 12 | children: ReactNode; 13 | content: ReactNode; 14 | }) { 15 | return ( 16 | 17 | {children} 18 | {content} 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /src/components/ui/checkbox.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as CheckboxPrimitive from "@radix-ui/react-checkbox" 3 | import { Check } from "lucide-react" 4 | 5 | import { cn } from "@/lib/utils" 6 | 7 | const Checkbox = React.forwardRef< 8 | React.ElementRef, 9 | React.ComponentPropsWithoutRef 10 | >(({ className, ...props }, ref) => ( 11 | 19 | 22 | 23 | 24 | 25 | )) 26 | Checkbox.displayName = CheckboxPrimitive.Root.displayName 27 | 28 | export { Checkbox } 29 | -------------------------------------------------------------------------------- /src/components/ui/collapsible.tsx: -------------------------------------------------------------------------------- 1 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" 2 | 3 | const Collapsible = CollapsiblePrimitive.Root 4 | 5 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger 6 | 7 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent 8 | 9 | export { Collapsible, CollapsibleTrigger, CollapsibleContent } 10 | -------------------------------------------------------------------------------- /src/components/ui/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface InputProps 6 | extends React.InputHTMLAttributes {} 7 | 8 | const Input = React.forwardRef( 9 | ({ className, type, ...props }, ref) => { 10 | return ( 11 | 20 | ) 21 | } 22 | ) 23 | Input.displayName = "Input" 24 | 25 | export { Input } 26 | -------------------------------------------------------------------------------- /src/components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as LabelPrimitive from "@radix-ui/react-label" 3 | import { cva, type VariantProps } from "class-variance-authority" 4 | 5 | import { cn } from "@/lib/utils" 6 | 7 | const labelVariants = cva( 8 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 9 | ) 10 | 11 | const Label = React.forwardRef< 12 | React.ElementRef, 13 | React.ComponentPropsWithoutRef & 14 | VariantProps 15 | >(({ className, ...props }, ref) => ( 16 | 21 | )) 22 | Label.displayName = LabelPrimitive.Root.displayName 23 | 24 | export { Label } 25 | -------------------------------------------------------------------------------- /src/components/ui/mode-toggle.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { Moon, Sun } from "lucide-react"; 4 | import { useTheme } from "next-themes"; 5 | 6 | import { Button } from "@/components/ui/button"; 7 | import { 8 | DropdownMenu, 9 | DropdownMenuContent, 10 | DropdownMenuItem, 11 | DropdownMenuTrigger, 12 | } from "@/components/ui/dropdown-menu"; 13 | 14 | export function ModeToggle() { 15 | const { setTheme } = useTheme(); 16 | 17 | return ( 18 | 19 | 20 | 25 | 26 | 27 | setTheme("light")}> 28 | Light 29 | 30 | setTheme("dark")}> 31 | Dark 32 | 33 | setTheme("system")}> 34 | System 35 | 36 | 37 | 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /src/components/ui/scroll-area.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" 3 | 4 | import { cn } from "@/lib/utils" 5 | 6 | const ScrollArea = React.forwardRef< 7 | React.ElementRef, 8 | React.ComponentPropsWithoutRef 9 | >(({ className, children, ...props }, ref) => ( 10 | 15 | 16 | {children} 17 | 18 | 19 | 20 | 21 | )) 22 | ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName 23 | 24 | const ScrollBar = React.forwardRef< 25 | React.ElementRef, 26 | React.ComponentPropsWithoutRef 27 | >(({ className, orientation = "vertical", ...props }, ref) => ( 28 | 41 | 42 | 43 | )) 44 | ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName 45 | 46 | export { ScrollArea, ScrollBar } 47 | -------------------------------------------------------------------------------- /src/components/ui/sonner.tsx: -------------------------------------------------------------------------------- 1 | import { useTheme } from "next-themes" 2 | import { Toaster as Sonner } from "sonner" 3 | 4 | type ToasterProps = React.ComponentProps 5 | 6 | const Toaster = ({ ...props }: ToasterProps) => { 7 | const { theme = "system" } = useTheme() 8 | 9 | return ( 10 | 26 | ) 27 | } 28 | 29 | export { Toaster } 30 | -------------------------------------------------------------------------------- /src/components/ui/switch.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as SwitchPrimitives from "@radix-ui/react-switch" 3 | 4 | import { cn } from "@/lib/utils" 5 | 6 | const Switch = React.forwardRef< 7 | React.ElementRef, 8 | React.ComponentPropsWithoutRef 9 | >(({ className, ...props }, ref) => ( 10 | 18 | 23 | 24 | )) 25 | Switch.displayName = SwitchPrimitives.Root.displayName 26 | 27 | export { Switch } 28 | -------------------------------------------------------------------------------- /src/components/ui/tooltip.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as TooltipPrimitive from "@radix-ui/react-tooltip" 3 | 4 | import { cn } from "@/lib/utils" 5 | 6 | const TooltipProvider = TooltipPrimitive.Provider 7 | 8 | const Tooltip = TooltipPrimitive.Root 9 | 10 | const TooltipTrigger = TooltipPrimitive.Trigger 11 | 12 | const TooltipContent = React.forwardRef< 13 | React.ElementRef, 14 | React.ComponentPropsWithoutRef 15 | >(({ className, sideOffset = 4, ...props }, ref) => ( 16 | 25 | )) 26 | TooltipContent.displayName = TooltipPrimitive.Content.displayName 27 | 28 | export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } 29 | -------------------------------------------------------------------------------- /src/dockerizers/angular/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "nginx.conf": "server {\n listen 80;\n listen [::]:80;\n server_name localhost;\n\n #access_log /var/log/nginx/host.access.log main;\n\n location / {\n root /usr/share/nginx/html;\n index index.html index.htm;\n }\n\n #error_page 404 /404.html;\n\n # redirect server error pages to the static page /50x.html\n #\n error_page 500 502 503 504 /50x.html;\n location = /50x.html {\n root /usr/share/nginx/html;\n }\n\n # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n #\n #location ~ \\.php$ {\n # proxy_pass http://127.0.0.1;\n #}\n\n # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n #\n #location ~ \\.php$ {\n # root html;\n # fastcgi_pass 127.0.0.1:9000;\n # fastcgi_index index.php;\n # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;\n # include fastcgi_params;\n #}\n\n # deny access to .htaccess files, if Apache's document root\n # concurs with nginx's one\n #\n #location ~ /\\.ht {\n # deny all;\n #}\n}", 3 | "Dockerfile.njk": "# Use official node image as the base image\nFROM {{ nodeImage }} 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 {{ nginxImage }}\nCOPY --from=build /app/dist/{{ projectName }}/browser /usr/share/nginx/html\nCOPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf\nEXPOSE {{ port }}\nCMD [\"nginx\", \"-g\", \"daemon off;\"]" 4 | } -------------------------------------------------------------------------------- /src/dockerizers/angular/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | # Use official node image as the base image 2 | FROM {{ nodeImage }} 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 {{ nginxImage }} 11 | COPY --from=build /app/dist/{{ projectName }}/browser /usr/share/nginx/html 12 | COPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf 13 | EXPOSE {{ port }} 14 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /src/dockerizers/angular/files/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name localhost; 5 | 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } -------------------------------------------------------------------------------- /src/dockerizers/angular/index.ts: -------------------------------------------------------------------------------- 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 | projectName: z.string().default("myApp"), 8 | nodeImage: z.string().default("node:18-alpine"), 9 | nginxImage: z.string().default("nginx:stable"), 10 | port: z.string().default("80"), 11 | }); 12 | 13 | export const nodeImageOptions = [ 14 | "node:16", 15 | "node:16-alpine", 16 | "node:18", 17 | "node:18-alpine", 18 | "node:20", 19 | "node:20-alpine", 20 | ]; 21 | 22 | export const nginxImageOptions = ["nginx:stable", "nginx:latest"]; 23 | 24 | export const defaultValues = schema.parse({}); 25 | 26 | export function generate(rawInput: z.infer): Files { 27 | const input = schema.parse(rawInput); 28 | return { 29 | Dockerfile: renderString(files["Dockerfile.njk"], input), 30 | "nginx.conf": files["nginx.conf"], 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/README.md: -------------------------------------------------------------------------------- 1 | # AngularTest 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.10. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use official node image as the base image 2 | FROM node:18-alpine 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:stable 11 | COPY --from=build /app/dist/myApp/browser /usr/share/nginx/html 12 | COPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf 13 | EXPOSE 80 14 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/dockerizer/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name localhost; 5 | 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-test", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test", 10 | "serve:ssr:angular-test": "node dist/angular-test/server/server.mjs" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^17.0.0", 15 | "@angular/common": "^17.0.0", 16 | "@angular/compiler": "^17.0.0", 17 | "@angular/core": "^17.0.0", 18 | "@angular/forms": "^17.0.0", 19 | "@angular/platform-browser": "^17.0.0", 20 | "@angular/platform-browser-dynamic": "^17.0.0", 21 | "@angular/platform-server": "^17.0.0", 22 | "@angular/router": "^17.0.0", 23 | "@angular/ssr": "^17.0.10", 24 | "express": "^4.18.2", 25 | "rxjs": "~7.8.0", 26 | "tslib": "^2.3.0", 27 | "zone.js": "~0.14.2" 28 | }, 29 | "devDependencies": { 30 | "@angular-devkit/build-angular": "^17.0.10", 31 | "@angular/cli": "^17.0.10", 32 | "@angular/compiler-cli": "^17.0.0", 33 | "@types/express": "^4.17.17", 34 | "@types/jasmine": "~5.1.0", 35 | "@types/node": "^18.18.0", 36 | "jasmine-core": "~5.1.0", 37 | "karma": "~6.4.0", 38 | "karma-chrome-launcher": "~3.2.0", 39 | "karma-coverage": "~2.2.0", 40 | "karma-jasmine": "~5.1.0", 41 | "karma-jasmine-html-reporter": "~2.1.0", 42 | "typescript": "~5.2.2" 43 | } 44 | } -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/server.ts: -------------------------------------------------------------------------------- 1 | import { APP_BASE_HREF } from '@angular/common'; 2 | import { CommonEngine } from '@angular/ssr'; 3 | import express from 'express'; 4 | import { fileURLToPath } from 'node:url'; 5 | import { dirname, join, resolve } from 'node:path'; 6 | import bootstrap from './src/main.server'; 7 | 8 | // The Express app is exported so that it can be used by serverless Functions. 9 | export function app(): express.Express { 10 | const server = express(); 11 | const serverDistFolder = dirname(fileURLToPath(import.meta.url)); 12 | const browserDistFolder = resolve(serverDistFolder, '../browser'); 13 | const indexHtml = join(serverDistFolder, 'index.server.html'); 14 | 15 | const commonEngine = new CommonEngine(); 16 | 17 | server.set('view engine', 'html'); 18 | server.set('views', browserDistFolder); 19 | 20 | // Example Express Rest API endpoints 21 | // server.get('/api/**', (req, res) => { }); 22 | // Serve static files from /browser 23 | server.get('*.*', express.static(browserDistFolder, { 24 | maxAge: '1y' 25 | })); 26 | 27 | // All regular routes use the Angular engine 28 | server.get('*', (req, res, next) => { 29 | const { protocol, originalUrl, baseUrl, headers } = req; 30 | 31 | commonEngine 32 | .render({ 33 | bootstrap, 34 | documentFilePath: indexHtml, 35 | url: `${protocol}://${headers.host}${originalUrl}`, 36 | publicPath: browserDistFolder, 37 | providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }], 38 | }) 39 | .then((html) => res.send(html)) 40 | .catch((err) => next(err)); 41 | }); 42 | 43 | return server; 44 | } 45 | 46 | function run(): void { 47 | const port = process.env['PORT'] || 4000; 48 | 49 | // Start up the Node server 50 | const server = app(); 51 | server.listen(port, () => { 52 | console.log(`Node Express server listening on http://localhost:${port}`); 53 | }); 54 | } 55 | 56 | run(); 57 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/angular/tests/default/code/src/app/app.component.css -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [AppComponent], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it(`should have the 'angular-test' title`, () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app.title).toEqual('angular-test'); 21 | }); 22 | 23 | it('should render title', () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | fixture.detectChanges(); 26 | const compiled = fixture.nativeElement as HTMLElement; 27 | expect(compiled.querySelector('h1')?.textContent).toContain('Hello, angular-test'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterOutlet } from '@angular/router'; 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | standalone: true, 8 | imports: [CommonModule, RouterOutlet], 9 | templateUrl: './app.component.html', 10 | styleUrl: './app.component.css' 11 | }) 12 | export class AppComponent { 13 | title = 'angular-test'; 14 | } 15 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/platform-server'; 3 | import { appConfig } from './app.config'; 4 | 5 | const serverConfig: ApplicationConfig = { 6 | providers: [ 7 | provideServerRendering() 8 | ] 9 | }; 10 | 11 | export const config = mergeApplicationConfig(appConfig, serverConfig); 12 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | 4 | import { routes } from './app.routes'; 5 | import { provideClientHydration } from '@angular/platform-browser'; 6 | 7 | export const appConfig: ApplicationConfig = { 8 | providers: [provideRouter(routes), provideClientHydration()] 9 | }; 10 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/angular/tests/default/code/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/angular/tests/default/code/src/favicon.ico -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularTest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { AppComponent } from './app/app.component'; 3 | import { config } from './app/app.config.server'; 4 | 5 | const bootstrap = () => bootstrapApplication(AppComponent, config); 6 | 7 | export default bootstrap; 8 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig) 6 | .catch((err) => console.error(err)); 7 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [ 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/main.ts", 12 | "src/main.server.ts", 13 | "server.ts" 14 | ], 15 | "include": [ 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/out-tsc", 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "noImplicitOverride": true, 9 | "noPropertyAccessFromIndexSignature": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "skipLibCheck": true, 13 | "esModuleInterop": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/code/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/dockerizers/angular/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dockerfile.njk": "# Base image\nFROM {{ nodeImage }}\n\n# Create app directory\nWORKDIR /usr/src/app\n\n# A wildcard is used to ensure both package.json AND package-lock.json are copied\nCOPY package*.json ./\n\n# Install app dependencies\nRUN npm install\n\n# Bundle app source\nCOPY . .\n\n# Creates a \"dist\" folder with the production build\nRUN npm run build\n\n# Start the server using the production build\nCMD [ \"node\", \"dist/main.js\" ]\n" 3 | } -------------------------------------------------------------------------------- /src/dockerizers/nestjs/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | # Base image 2 | FROM {{ nodeImage }} 3 | 4 | # Create app directory 5 | WORKDIR /usr/src/app 6 | 7 | # A wildcard is used to ensure both package.json AND package-lock.json are copied 8 | COPY package*.json ./ 9 | 10 | # Install app dependencies 11 | RUN npm install 12 | 13 | # Bundle app source 14 | COPY . . 15 | 16 | # Creates a "dist" folder with the production build 17 | RUN npm run build 18 | 19 | # Start the server using the production build 20 | CMD [ "node", "dist/main.js" ] 21 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/index.ts: -------------------------------------------------------------------------------- 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 | nodeImage: z.string().default("node:18"), 8 | }); 9 | 10 | export const nodeImageOptions = [ 11 | "node:16", 12 | "node:16-alpine", 13 | "node:18", 14 | "node:18-alpine", 15 | "node:20", 16 | "node:20-alpine", 17 | ]; 18 | 19 | export const defaultValues = schema.parse({}); 20 | 21 | export function generate(rawInput: z.infer): Files { 22 | const input = schema.parse(rawInput); 23 | return { 24 | Dockerfile: renderString(files["Dockerfile.njk"], input), 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | project: 'tsconfig.json', 5 | tsconfigRootDir: __dirname, 6 | sourceType: 'module', 7 | }, 8 | plugins: ['@typescript-eslint/eslint-plugin'], 9 | extends: [ 10 | 'plugin:@typescript-eslint/recommended', 11 | 'plugin:prettier/recommended', 12 | ], 13 | root: true, 14 | env: { 15 | node: true, 16 | jest: true, 17 | }, 18 | ignorePatterns: ['.eslintrc.js'], 19 | rules: { 20 | '@typescript-eslint/interface-name-prefix': 'off', 21 | '@typescript-eslint/explicit-function-return-type': 'off', 22 | '@typescript-eslint/explicit-module-boundary-types': 'off', 23 | '@typescript-eslint/no-explicit-any': 'off', 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist 3 | /node_modules 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | pnpm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | 14 | # OS 15 | .DS_Store 16 | 17 | # Tests 18 | /coverage 19 | /.nyc_output 20 | 21 | # IDEs and editors 22 | /.idea 23 | .project 24 | .classpath 25 | .c9/ 26 | *.launch 27 | .settings/ 28 | *.sublime-workspace 29 | 30 | # IDE - VSCode 31 | .vscode/* 32 | !.vscode/settings.json 33 | !.vscode/tasks.json 34 | !.vscode/launch.json 35 | !.vscode/extensions.json -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Base image 2 | FROM node:18 3 | 4 | # Create app directory 5 | WORKDIR /usr/src/app 6 | 7 | # A wildcard is used to ensure both package.json AND package-lock.json are copied 8 | COPY package*.json ./ 9 | 10 | # Install app dependencies 11 | RUN npm install 12 | 13 | # Bundle app source 14 | COPY . . 15 | 16 | # Creates a "dist" folder with the production build 17 | RUN npm run build 18 | 19 | # Start the server using the production build 20 | CMD [ "node", "dist/main.js" ] 21 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/nest-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/nest-cli", 3 | "collection": "@nestjs/schematics", 4 | "sourceRoot": "src", 5 | "compilerOptions": { 6 | "deleteOutDir": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/src/app.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { AppController } from './app.controller'; 3 | import { AppService } from './app.service'; 4 | 5 | describe('AppController', () => { 6 | let appController: AppController; 7 | 8 | beforeEach(async () => { 9 | const app: TestingModule = await Test.createTestingModule({ 10 | controllers: [AppController], 11 | providers: [AppService], 12 | }).compile(); 13 | 14 | appController = app.get(AppController); 15 | }); 16 | 17 | describe('root', () => { 18 | it('should return "Hello World!"', () => { 19 | expect(appController.getHello()).toBe('Hello World!'); 20 | }); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/src/app.controller.ts: -------------------------------------------------------------------------------- 1 | import { Controller, Get } from '@nestjs/common'; 2 | import { AppService } from './app.service'; 3 | 4 | @Controller() 5 | export class AppController { 6 | constructor(private readonly appService: AppService) {} 7 | 8 | @Get() 9 | getHello(): string { 10 | return this.appService.getHello(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/src/app.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AppController } from './app.controller'; 3 | import { AppService } from './app.service'; 4 | 5 | @Module({ 6 | imports: [], 7 | controllers: [AppController], 8 | providers: [AppService], 9 | }) 10 | export class AppModule {} 11 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/src/app.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | 3 | @Injectable() 4 | export class AppService { 5 | getHello(): string { 6 | return 'Hello World! Dockerized'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/src/main.ts: -------------------------------------------------------------------------------- 1 | import { NestFactory } from '@nestjs/core'; 2 | import { AppModule } from './app.module'; 3 | 4 | async function bootstrap() { 5 | const app = await NestFactory.create(AppModule); 6 | await app.listen(3000); 7 | } 8 | bootstrap(); 9 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/test/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { INestApplication } from '@nestjs/common'; 3 | import * as request from 'supertest'; 4 | import { AppModule } from './../src/app.module'; 5 | 6 | describe('AppController (e2e)', () => { 7 | let app: INestApplication; 8 | 9 | beforeEach(async () => { 10 | const moduleFixture: TestingModule = await Test.createTestingModule({ 11 | imports: [AppModule], 12 | }).compile(); 13 | 14 | app = moduleFixture.createNestApplication(); 15 | await app.init(); 16 | }); 17 | 18 | it('/ (GET)', () => { 19 | return request(app.getHttpServer()) 20 | .get('/') 21 | .expect(200) 22 | .expect('Hello World!'); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/test/jest-e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleFileExtensions": ["js", "json", "ts"], 3 | "rootDir": ".", 4 | "testEnvironment": "node", 5 | "testRegex": ".e2e-spec.ts$", 6 | "transform": { 7 | "^.+\\.(t|j)s$": "ts-jest" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/code/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "declaration": true, 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "target": "ES2021", 10 | "sourceMap": true, 11 | "outDir": "./dist", 12 | "baseUrl": "./", 13 | "incremental": true, 14 | "skipLibCheck": true, 15 | "strictNullChecks": false, 16 | "noImplicitAny": false, 17 | "strictBindCallApply": false, 18 | "forceConsistentCasingInFileNames": false, 19 | "noFallthroughCasesInSwitch": false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/nestjs/tests/default/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/nestjs/tests/default/test.sh -------------------------------------------------------------------------------- /src/dockerizers/nextjs/index.ts: -------------------------------------------------------------------------------- 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 | nodeImage: z.string().default("node:20"), 8 | telemetry: z.boolean().default(false), 9 | host: z.string().default("0.0.0.0"), 10 | port: z.string().default("3000"), 11 | // advanced 12 | user: z.string().default("nextjs"), 13 | group: z.string().default("nodejs"), 14 | alpinePackages: z.string().default("libc6-compat"), 15 | }); 16 | 17 | export const nodeImageOptions = [ 18 | "node:16", 19 | "node:16-alpine", 20 | "node:18", 21 | "node:18-alpine", 22 | "node:20", 23 | "node:20-alpine", 24 | ]; 25 | 26 | export const defaultValues = schema.parse({}); 27 | 28 | export function generate(rawInput: z.infer): Files { 29 | const input = schema.parse(rawInput); 30 | return { 31 | Dockerfile: renderString(files["Dockerfile.njk"], input), 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/README.md: -------------------------------------------------------------------------------- 1 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | # or 12 | pnpm dev 13 | # or 14 | bun dev 15 | ``` 16 | 17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 18 | 19 | You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. 20 | 21 | [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. 22 | 23 | The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. 24 | 25 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. 26 | 27 | ## Learn More 28 | 29 | To learn more about Next.js, take a look at the following resources: 30 | 31 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 32 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 33 | 34 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 35 | 36 | ## Deploy on Vercel 37 | 38 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 39 | 40 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 41 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | output: "standalone", 5 | }; 6 | 7 | module.exports = nextConfig; 8 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "react": "^18", 13 | "react-dom": "^18", 14 | "next": "14.0.4" 15 | }, 16 | "devDependencies": { 17 | "typescript": "^5", 18 | "@types/node": "^20", 19 | "@types/react": "^18", 20 | "@types/react-dom": "^18", 21 | "autoprefixer": "^10.0.1", 22 | "postcss": "^8", 23 | "tailwindcss": "^3.3.0", 24 | "eslint": "^8", 25 | "eslint-config-next": "14.0.4" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/nextjs/tests/default/code/public/favicon.ico -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import '@/styles/globals.css' 2 | import type { AppProps } from 'next/app' 3 | 4 | export default function App({ Component, pageProps }: AppProps) { 5 | return 6 | } 7 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/src/pages/_document.tsx: -------------------------------------------------------------------------------- 1 | import { Html, Head, Main, NextScript } from 'next/document' 2 | 3 | export default function Document() { 4 | return ( 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/src/pages/api/hello.ts: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | import type { NextApiRequest, NextApiResponse } from 'next' 3 | 4 | type Data = { 5 | name: string 6 | } 7 | 8 | export default function handler( 9 | req: NextApiRequest, 10 | res: NextApiResponse 11 | ) { 12 | res.status(200).json({ name: 'John Doe' }) 13 | } 14 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/src/styles/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --foreground-rgb: 0, 0, 0; 7 | --background-start-rgb: 214, 219, 220; 8 | --background-end-rgb: 255, 255, 255; 9 | } 10 | 11 | @media (prefers-color-scheme: dark) { 12 | :root { 13 | --foreground-rgb: 255, 255, 255; 14 | --background-start-rgb: 0, 0, 0; 15 | --background-end-rgb: 0, 0, 0; 16 | } 17 | } 18 | 19 | body { 20 | color: rgb(var(--foreground-rgb)); 21 | background: linear-gradient( 22 | to bottom, 23 | transparent, 24 | rgb(var(--background-end-rgb)) 25 | ) 26 | rgb(var(--background-start-rgb)); 27 | } 28 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'tailwindcss' 2 | 3 | const config: Config = { 4 | content: [ 5 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}', 6 | './src/components/**/*.{js,ts,jsx,tsx,mdx}', 7 | './src/app/**/*.{js,ts,jsx,tsx,mdx}', 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 13 | 'gradient-conic': 14 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | } 20 | export default config 21 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/code/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "paths": { 17 | "@/*": ["./src/*"] 18 | } 19 | }, 20 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 21 | "exclude": ["node_modules"] 22 | } 23 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/nextjs/tests/default/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/nextjs/tests/default/test.sh -------------------------------------------------------------------------------- /src/dockerizers/nodejs/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dockerfile.njk": "# Base image\nFROM {{ nodeImage }}\n\n# Create app directory\nWORKDIR /usr/src/app\n\n# A wildcard is used to ensure both package.json AND package-lock.json are copied\nCOPY package*.json ./\n\n# Install app dependencies\nRUN npm install\n\n# Bundle app source\nCOPY . .\n\n# Start the server using the production build\nCMD [ \"node\", \"index.js\" ]\n\n# Exposing server port\nEXPOSE {{ port }}" 3 | } -------------------------------------------------------------------------------- /src/dockerizers/nodejs/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | # Base image 2 | FROM {{ nodeImage }} 3 | 4 | # Create app directory 5 | WORKDIR /usr/src/app 6 | 7 | # A wildcard is used to ensure both package.json AND package-lock.json are copied 8 | COPY package*.json ./ 9 | 10 | # Install app dependencies 11 | RUN npm install 12 | 13 | # Bundle app source 14 | COPY . . 15 | 16 | # Start the server using the production build 17 | CMD [ "node", "index.js" ] 18 | 19 | # Exposing server port 20 | EXPOSE {{ port }} -------------------------------------------------------------------------------- /src/dockerizers/nodejs/index.ts: -------------------------------------------------------------------------------- 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 | nodeImage: z.string().default("node:18"), 8 | port: z.number().default(3000), 9 | }); 10 | 11 | export const nodeImageOptions = [ 12 | "node:16", 13 | "node:16-alpine", 14 | "node:18", 15 | "node:18-alpine", 16 | "node:20", 17 | "node:20-alpine", 18 | ]; 19 | 20 | export const defaultValues = schema.parse({}); 21 | 22 | export function generate(rawInput: z.infer): Files { 23 | const input = schema.parse(rawInput); 24 | return { 25 | Dockerfile: renderString(files["Dockerfile.njk"], input), 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /src/dockerizers/nodejs/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /src/dockerizers/nodejs/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Base image 2 | FROM node:18 3 | 4 | # Create app directory 5 | WORKDIR /usr/src/app 6 | 7 | # A wildcard is used to ensure both package.json AND package-lock.json are copied 8 | COPY package*.json ./ 9 | 10 | # Install app dependencies 11 | RUN npm install 12 | 13 | # Bundle app source 14 | COPY . . 15 | 16 | # Start the server using the production build 17 | CMD [ "node", "index.js" ] 18 | 19 | # Exposing server port 20 | EXPOSE 3000 -------------------------------------------------------------------------------- /src/dockerizers/nodejs/tests/default/code/index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const app = express(); 3 | const router = express.Router(); 4 | 5 | const port = 3000; 6 | 7 | router.use(function (req, res, next) { 8 | console.log("/" + req.method); 9 | next(); 10 | }); 11 | 12 | router.get("/", function (req, res) { 13 | res.send("Hello dockerized"); 14 | }); 15 | 16 | app.use("/", router); 17 | 18 | app.listen(port, function () { 19 | console.log("Example app listening on port 3000!"); 20 | }); 21 | -------------------------------------------------------------------------------- /src/dockerizers/nodejs/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-express", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "start": "node index.js" 6 | }, 7 | "description": "node-express", 8 | "author": "Easypanel", 9 | "license": "MIT", 10 | "main": "index.js", 11 | "keywords": [ 12 | "nodejs", 13 | "express" 14 | ], 15 | "dependencies": { 16 | "express": "^4.16.4" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/dockerizers/nodejs/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/nodejs/tests/default/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/nodejs/tests/default/test.sh -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dockerfile.njk": "FROM {{nodeImage}}\n\nWORKDIR /app\n\nCOPY package*.json ./\n\nRUN npm install\n\nCOPY . .\n\nEXPOSE {{port}}\n\nRUN npm run build\nCMD [ \"npm\", \"run\", \"start\" ]" 3 | } -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | FROM {{nodeImage}} 2 | 3 | WORKDIR /app 4 | 5 | COPY package*.json ./ 6 | 7 | RUN npm install 8 | 9 | COPY . . 10 | 11 | EXPOSE {{port}} 12 | 13 | RUN npm run build 14 | CMD [ "npm", "run", "start" ] -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/index.ts: -------------------------------------------------------------------------------- 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 | nodeImage: z.string().default("node:20"), 8 | port: z.string().default("3000"), 9 | }); 10 | 11 | export const nodeImageOptions = [ 12 | "node:16", 13 | "node:16-alpine", 14 | "node:18", 15 | "node:18-alpine", 16 | "node:20", 17 | "node:20-alpine", 18 | ]; 19 | 20 | export const defaultValues = schema.parse({}); 21 | 22 | export function generate(rawInput: z.infer): Files { 23 | const input = schema.parse(rawInput); 24 | return { 25 | Dockerfile: renderString(files["Dockerfile.njk"], input), 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | # Nuxt dev/build outputs 2 | .output 3 | .data 4 | .nuxt 5 | .nitro 6 | .cache 7 | dist 8 | 9 | # Node dependencies 10 | node_modules 11 | 12 | # Logs 13 | logs 14 | *.log 15 | 16 | # Misc 17 | .DS_Store 18 | .fleet 19 | .idea 20 | 21 | # Local env files 22 | .env 23 | .env.* 24 | !.env.example 25 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/README.md: -------------------------------------------------------------------------------- 1 | # Nuxt 3 Minimal Starter 2 | 3 | Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. 4 | 5 | ## Setup 6 | 7 | Make sure to install the dependencies: 8 | 9 | ```bash 10 | # npm 11 | npm install 12 | 13 | # pnpm 14 | pnpm install 15 | 16 | # yarn 17 | yarn install 18 | 19 | # bun 20 | bun install 21 | ``` 22 | 23 | ## Development Server 24 | 25 | Start the development server on `http://localhost:3000`: 26 | 27 | ```bash 28 | # npm 29 | npm run dev 30 | 31 | # pnpm 32 | pnpm run dev 33 | 34 | # yarn 35 | yarn dev 36 | 37 | # bun 38 | bun run dev 39 | ``` 40 | 41 | ## Production 42 | 43 | Build the application for production: 44 | 45 | ```bash 46 | # npm 47 | npm run build 48 | 49 | # pnpm 50 | pnpm run build 51 | 52 | # yarn 53 | yarn build 54 | 55 | # bun 56 | bun run build 57 | ``` 58 | 59 | Locally preview production build: 60 | 61 | ```bash 62 | # npm 63 | npm run preview 64 | 65 | # pnpm 66 | pnpm run preview 67 | 68 | # yarn 69 | yarn preview 70 | 71 | # bun 72 | bun run preview 73 | ``` 74 | 75 | Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. 76 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/app.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 2 | 3 | WORKDIR /app 4 | 5 | COPY package*.json ./ 6 | 7 | RUN npm install 8 | 9 | COPY . . 10 | 11 | EXPOSE 3000 12 | 13 | RUN npm run build 14 | CMD [ "npm", "run", "start" ] -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | // https://nuxt.com/docs/api/configuration/nuxt-config 2 | export default defineNuxtConfig({ 3 | devtools: { enabled: true } 4 | }) 5 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-app", 3 | "private": true, 4 | "type": "module", 5 | "scripts": { 6 | "build": "nuxt build", 7 | "dev": "nuxt dev", 8 | "start": "nuxt start", 9 | "generate": "nuxt generate", 10 | "preview": "nuxt preview", 11 | "postinstall": "nuxt prepare" 12 | }, 13 | "devDependencies": { 14 | "nuxt": "^3.9.1", 15 | "vue": "^3.4.10", 16 | "vue-router": "^4.2.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/nuxtjs/tests/default/code/public/favicon.ico -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.nuxt/tsconfig.server.json" 3 | } 4 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/code/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://nuxt.com/docs/guide/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/nuxtjs/tests/default/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/nuxtjs/tests/default/test.sh -------------------------------------------------------------------------------- /src/dockerizers/php/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "php.ini.njk": "date.time = {{ phpDateTimezone }} \ndisplay_errors = {{ phpDisplayErrors }}\nmemory_limit = {{ phpMemoryLimit }} \nmax_execution_time = {{ phpMaxExecutionTime }}\npost_max_size = {{ phpPostMaxSize }}\nupload_max_filesize = {{ phpUploadMaxFilesize }}", 3 | "nginx-vhost.conf.njk": "server {\n listen 80 default_server;\n\n server_name _;\n\n root \"{{ documentRoot }}\";\n index index.php;\n\n client_max_body_size 50m;\n\n access_log /docker.stdout;\n error_log /docker.stderr warn;\n\n location / {\n try_files $uri $uri/ /index.php?$query_string;\n }\n\n location ~ \\.php$ {\n fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n fastcgi_pass php;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME $request_filename;\n fastcgi_read_timeout 600;\n }\n}", 4 | "apache-vhost.conf.njk": "\n ServerAlias *\n DocumentRoot \"{{ documentRoot }}\"\n", 5 | "Dockerfile.njk": "FROM webdevops/php-{{ webServer }}:{{ phpVersion }}{{ '-alpine' if alpine }}\n\nCOPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini\n{%- if webServer === \"apache\" %}\nCOPY ./dockerizer/vhost.conf /opt/docker/etc/httpd/vhost.conf\n{%- endif %}\n{%- if webServer === \"nginx\" %}\nCOPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf\n{%- endif %}\n{%- if composerInstall %}\nCOPY composer.json composer.lock /app/\nRUN composer install --no-interaction --no-scripts --no-suggest\n{%- endif %}\nCOPY . /app" 6 | } -------------------------------------------------------------------------------- /src/dockerizers/php/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | FROM webdevops/php-{{ webServer }}:{{ phpVersion }}{{ '-alpine' if alpine }} 2 | 3 | COPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini 4 | {%- if webServer === "apache" %} 5 | COPY ./dockerizer/vhost.conf /opt/docker/etc/httpd/vhost.conf 6 | {%- endif %} 7 | {%- if webServer === "nginx" %} 8 | COPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf 9 | {%- endif %} 10 | {%- if composerInstall %} 11 | COPY composer.json composer.lock /app/ 12 | RUN composer install --no-interaction --no-scripts --no-suggest 13 | {%- endif %} 14 | COPY . /app -------------------------------------------------------------------------------- /src/dockerizers/php/files/apache-vhost.conf.njk: -------------------------------------------------------------------------------- 1 | 2 | ServerAlias * 3 | DocumentRoot "{{ documentRoot }}" 4 | -------------------------------------------------------------------------------- /src/dockerizers/php/files/nginx-vhost.conf.njk: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | 4 | server_name _; 5 | 6 | root "{{ documentRoot }}"; 7 | index index.php; 8 | 9 | client_max_body_size 50m; 10 | 11 | access_log /docker.stdout; 12 | error_log /docker.stderr warn; 13 | 14 | location / { 15 | try_files $uri $uri/ /index.php?$query_string; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | fastcgi_pass php; 21 | include fastcgi_params; 22 | fastcgi_param SCRIPT_FILENAME $request_filename; 23 | fastcgi_read_timeout 600; 24 | } 25 | } -------------------------------------------------------------------------------- /src/dockerizers/php/files/php.ini.njk: -------------------------------------------------------------------------------- 1 | date.time = {{ phpDateTimezone }} 2 | display_errors = {{ phpDisplayErrors }} 3 | memory_limit = {{ phpMemoryLimit }} 4 | max_execution_time = {{ phpMaxExecutionTime }} 5 | post_max_size = {{ phpPostMaxSize }} 6 | upload_max_filesize = {{ phpUploadMaxFilesize }} -------------------------------------------------------------------------------- /src/dockerizers/php/index.ts: -------------------------------------------------------------------------------- 1 | import { Files } from "@/lib/types"; 2 | import { renderString } from "nunjucks"; 3 | import path from "path"; 4 | import { z } from "zod"; 5 | import files from "./files.json"; 6 | 7 | export const schema = z.object({ 8 | phpVersion: z.string().default("8.2"), 9 | alpine: z.boolean().default(true), 10 | documentRoot: z.string().default("/"), 11 | webServer: z.string().default("nginx"), 12 | composerInstall: z.boolean().default(false), 13 | 14 | phpDateTimezone: z.string().default("UTC"), 15 | phpDisplayErrors: z.string().default("Off"), 16 | phpMemoryLimit: z.string().default("128M"), 17 | phpMaxExecutionTime: z.number().default(60), 18 | phpPostMaxSize: z.string().default("32M"), 19 | phpUploadMaxFilesize: z.string().default("16M"), 20 | }); 21 | 22 | export const webServerOptions = ["apache", "nginx"]; 23 | 24 | export const phpVersionOptions = ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]; 25 | 26 | export const defaultValues = schema.parse({}); 27 | 28 | export function generate(rawInput: z.infer): Files { 29 | const input = schema.parse(rawInput); 30 | input.documentRoot = path.join("/app", input.documentRoot); 31 | 32 | return { 33 | Dockerfile: renderString(files["Dockerfile.njk"], input), 34 | "vhost.conf": 35 | input.webServer === "nginx" 36 | ? renderString(files["nginx-vhost.conf.njk"], input) 37 | : renderString(files["apache-vhost.conf.njk"], input), 38 | "php.ini": renderString(files["php.ini.njk"], input), 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/apache/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM webdevops/php-apache:8.2-alpine 2 | 3 | COPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini 4 | COPY ./dockerizer/vhost.conf /opt/docker/etc/httpd/vhost.conf 5 | COPY . /app -------------------------------------------------------------------------------- /src/dockerizers/php/tests/apache/code/dockerizer/php.ini: -------------------------------------------------------------------------------- 1 | date.time = UTC 2 | display_errors = Off 3 | memory_limit = 128M 4 | max_execution_time = 60 5 | post_max_size = 32M 6 | upload_max_filesize = 16M -------------------------------------------------------------------------------- /src/dockerizers/php/tests/apache/code/dockerizer/vhost.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerAlias * 3 | DocumentRoot "/app/" 4 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/apache/code/index.php: -------------------------------------------------------------------------------- 1 | Dockerizer"; -------------------------------------------------------------------------------- /src/dockerizers/php/tests/apache/input.json: -------------------------------------------------------------------------------- 1 | { "webServer": "apache" } 2 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM webdevops/php-nginx:8.2-alpine 2 | 3 | COPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini 4 | COPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf 5 | COPY . /app -------------------------------------------------------------------------------- /src/dockerizers/php/tests/default/code/dockerizer/php.ini: -------------------------------------------------------------------------------- 1 | date.time = UTC 2 | display_errors = Off 3 | memory_limit = 128M 4 | max_execution_time = 60 5 | post_max_size = 32M 6 | upload_max_filesize = 16M -------------------------------------------------------------------------------- /src/dockerizers/php/tests/default/code/dockerizer/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | 4 | server_name _; 5 | 6 | root "/app/"; 7 | index index.php; 8 | 9 | client_max_body_size 50m; 10 | 11 | access_log /docker.stdout; 12 | error_log /docker.stderr warn; 13 | 14 | location / { 15 | try_files $uri $uri/ /index.php?$query_string; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | fastcgi_pass php; 21 | include fastcgi_params; 22 | fastcgi_param SCRIPT_FILENAME $request_filename; 23 | fastcgi_read_timeout 600; 24 | } 25 | } -------------------------------------------------------------------------------- /src/dockerizers/php/tests/default/code/index.php: -------------------------------------------------------------------------------- 1 | Dockerizer"; -------------------------------------------------------------------------------- /src/dockerizers/php/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/document-root/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM webdevops/php-nginx:8.2-alpine 2 | 3 | COPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini 4 | COPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf 5 | COPY . /app -------------------------------------------------------------------------------- /src/dockerizers/php/tests/document-root/code/dockerizer/php.ini: -------------------------------------------------------------------------------- 1 | date.time = UTC 2 | display_errors = Off 3 | memory_limit = 128M 4 | max_execution_time = 60 5 | post_max_size = 32M 6 | upload_max_filesize = 16M -------------------------------------------------------------------------------- /src/dockerizers/php/tests/document-root/code/dockerizer/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | 4 | server_name _; 5 | 6 | root "/app/public"; 7 | index index.php; 8 | 9 | client_max_body_size 50m; 10 | 11 | access_log /docker.stdout; 12 | error_log /docker.stderr warn; 13 | 14 | location / { 15 | try_files $uri $uri/ /index.php?$query_string; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | fastcgi_pass php; 21 | include fastcgi_params; 22 | fastcgi_param SCRIPT_FILENAME $request_filename; 23 | fastcgi_read_timeout 600; 24 | } 25 | } -------------------------------------------------------------------------------- /src/dockerizers/php/tests/document-root/code/public/index.php: -------------------------------------------------------------------------------- 1 | Dockerizer document root"; -------------------------------------------------------------------------------- /src/dockerizers/php/tests/document-root/input.json: -------------------------------------------------------------------------------- 1 | { "documentRoot": "/public" } 2 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=laravel 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailpit 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_HOST= 50 | PUSHER_PORT=443 51 | PUSHER_SCHEME=https 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | VITE_APP_NAME="${APP_NAME}" 55 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 56 | VITE_PUSHER_HOST="${PUSHER_HOST}" 57 | VITE_PUSHER_PORT="${PUSHER_PORT}" 58 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 59 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 60 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /node_modules 3 | /public/build 4 | /public/hot 5 | /public/storage 6 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | .phpunit.result.cache 12 | Homestead.json 13 | Homestead.yaml 14 | auth.json 15 | npm-debug.log 16 | yarn-error.log 17 | /.fleet 18 | /.idea 19 | /.vscode 20 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 16 | } 17 | 18 | /** 19 | * Register the commands for the application. 20 | */ 21 | protected function commands(): void 22 | { 23 | $this->load(__DIR__.'/Commands'); 24 | 25 | require base_path('routes/console.php'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $dontFlash = [ 16 | 'current_password', 17 | 'password', 18 | 'password_confirmation', 19 | ]; 20 | 21 | /** 22 | * Register the exception handling callbacks for the application. 23 | */ 24 | public function register(): void 25 | { 26 | $this->reportable(function (Throwable $e) { 27 | // 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | expectsJson() ? null : route('login'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect(RouteServiceProvider::HOME); 25 | } 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts(): array 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Models/User.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * The attributes that should be cast. 38 | * 39 | * @var array 40 | */ 41 | protected $casts = [ 42 | 'email_verified_at' => 'datetime', 43 | 'password' => 'hashed', 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | */ 22 | public function boot(): void 23 | { 24 | // 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | */ 26 | public function boot(): void 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Determine if events and listeners should be automatically discovered. 33 | */ 34 | public function shouldDiscoverEvents(): bool 35 | { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | by($request->user()?->id ?: $request->ip()); 29 | }); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 12), 33 | 'verify' => true, 34 | ], 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Argon Options 39 | |-------------------------------------------------------------------------- 40 | | 41 | | Here you may specify the configuration options that should be used when 42 | | passwords are hashed using the Argon algorithm. These will allow you 43 | | to control the amount of time it takes to hash the given password. 44 | | 45 | */ 46 | 47 | 'argon' => [ 48 | 'memory' => 65536, 49 | 'threads' => 1, 50 | 'time' => 4, 51 | 'verify' => true, 52 | ], 53 | 54 | ]; 55 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class UserFactory extends Factory 13 | { 14 | /** 15 | * The current password being used by the factory. 16 | */ 17 | protected static ?string $password; 18 | 19 | /** 20 | * Define the model's default state. 21 | * 22 | * @return array 23 | */ 24 | public function definition(): array 25 | { 26 | return [ 27 | 'name' => fake()->name(), 28 | 'email' => fake()->unique()->safeEmail(), 29 | 'email_verified_at' => now(), 30 | 'password' => static::$password ??= Hash::make('password'), 31 | 'remember_token' => Str::random(10), 32 | ]; 33 | } 34 | 35 | /** 36 | * Indicate that the model's email address should be unverified. 37 | */ 38 | public function unverified(): static 39 | { 40 | return $this->state(fn (array $attributes) => [ 41 | 'email_verified_at' => null, 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('email')->unique(); 18 | $table->timestamp('email_verified_at')->nullable(); 19 | $table->string('password'); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('users'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('password_reset_tokens'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('uuid')->unique(); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->longText('exception'); 21 | $table->timestamp('failed_at')->useCurrent(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('failed_jobs'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | // \App\Models\User::factory()->create([ 18 | // 'name' => 'Test User', 19 | // 'email' => 'test@example.com', 20 | // ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM webdevops/php-nginx:8.2-alpine 2 | 3 | COPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini 4 | COPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf 5 | COPY composer.json composer.lock /app/ 6 | RUN composer install --no-interaction --no-scripts --no-suggest 7 | COPY . /app -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/dockerizer/php.ini: -------------------------------------------------------------------------------- 1 | date.time = UTC 2 | display_errors = Off 3 | memory_limit = 128M 4 | max_execution_time = 60 5 | post_max_size = 32M 6 | upload_max_filesize = 16M -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/dockerizer/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | 4 | server_name _; 5 | 6 | root "/app/public"; 7 | index index.php; 8 | 9 | client_max_body_size 50m; 10 | 11 | access_log /docker.stdout; 12 | error_log /docker.stderr warn; 13 | 14 | location / { 15 | try_files $uri $uri/ /index.php?$query_string; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | fastcgi_pass php; 21 | include fastcgi_params; 22 | fastcgi_param SCRIPT_FILENAME $request_filename; 23 | fastcgi_read_timeout 600; 24 | } 25 | } -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "devDependencies": { 9 | "axios": "^1.6.4", 10 | "laravel-vite-plugin": "^1.0.0", 11 | "vite": "^5.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | tests/Unit 10 | 11 | 12 | tests/Feature 13 | 14 | 15 | 16 | 17 | app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/php/tests/laravel/code/public/favicon.ico -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/php/tests/laravel/code/resources/css/app.css -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * We'll load the axios HTTP library which allows us to easily issue requests 3 | * to our Laravel back-end. This library automatically handles sending the 4 | * CSRF token as a header based on the value of the "XSRF" token cookie. 5 | */ 6 | 7 | import axios from 'axios'; 8 | window.axios = axios; 9 | 10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 11 | 12 | /** 13 | * Echo exposes an expressive API for subscribing to channels and listening 14 | * for events that are broadcast by Laravel. Echo and event broadcasting 15 | * allows your team to easily build robust real-time web applications. 16 | */ 17 | 18 | // import Echo from 'laravel-echo'; 19 | 20 | // import Pusher from 'pusher-js'; 21 | // window.Pusher = Pusher; 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', 27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 31 | // enabledTransports: ['ws', 'wss'], 32 | // }); 33 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/routes/web.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 18 | 19 | return $app; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/code/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /src/dockerizers/php/tests/laravel/input.json: -------------------------------------------------------------------------------- 1 | { "documentRoot": "/public", "composerInstall": true } 2 | -------------------------------------------------------------------------------- /src/dockerizers/react/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "nginx.conf": "server {\n listen 80;\n listen [::]:80;\n server_name localhost;\n\n #access_log /var/log/nginx/host.access.log main;\n\n location / {\n root /usr/share/nginx/html;\n index index.html index.htm;\n }\n\n #error_page 404 /404.html;\n\n # redirect server error pages to the static page /50x.html\n #\n error_page 500 502 503 504 /50x.html;\n location = /50x.html {\n root /usr/share/nginx/html;\n }\n\n # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n #\n #location ~ \\.php$ {\n # proxy_pass http://127.0.0.1;\n #}\n\n # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n #\n #location ~ \\.php$ {\n # root html;\n # fastcgi_pass 127.0.0.1:9000;\n # fastcgi_index index.php;\n # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;\n # include fastcgi_params;\n #}\n\n # deny access to .htaccess files, if Apache's document root\n # concurs with nginx's one\n #\n #location ~ /\\.ht {\n # deny all;\n #}\n}", 3 | "Dockerfile.njk": "# build stage\nFROM {{ nodeImage }} as build\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install\nCOPY . .\nRUN npm run build\n\n# production stage\nFROM {{ nginxImage }} as production\nCOPY --from=build /app/dist /usr/share/nginx/html\nCOPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf\nEXPOSE {{ port }}\nCMD [\"nginx\", \"-g\", \"daemon off;\"]" 4 | } -------------------------------------------------------------------------------- /src/dockerizers/react/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | # build stage 2 | FROM {{ nodeImage }} as build 3 | WORKDIR /app 4 | COPY package*.json ./ 5 | RUN npm install 6 | COPY . . 7 | RUN npm run build 8 | 9 | # production stage 10 | FROM {{ nginxImage }} as production 11 | COPY --from=build /app/dist /usr/share/nginx/html 12 | COPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf 13 | EXPOSE {{ port }} 14 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /src/dockerizers/react/files/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name localhost; 5 | 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } -------------------------------------------------------------------------------- /src/dockerizers/react/index.ts: -------------------------------------------------------------------------------- 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 | nodeImage: z.string().default("node:20"), 8 | nginxImage: z.string().default("nginx:stable"), 9 | port: z.string().default("80"), 10 | }); 11 | 12 | export const nodeImageOptions = [ 13 | "node:16", 14 | "node:16-alpine", 15 | "node:18", 16 | "node:18-alpine", 17 | "node:20", 18 | "node:20-alpine", 19 | ]; 20 | 21 | export const nginxImageOptions = ["nginx:stable", "nginx:latest"]; 22 | 23 | export const defaultValues = schema.parse({}); 24 | 25 | export function generate(rawInput: z.infer): Files { 26 | const input = schema.parse(rawInput); 27 | return { 28 | Dockerfile: renderString(files["Dockerfile.njk"], input), 29 | "nginx.conf": files["nginx.conf"], 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | ignorePatterns: ['dist', '.eslintrc.cjs'], 10 | parser: '@typescript-eslint/parser', 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': [ 14 | 'warn', 15 | { allowConstantExport: true }, 16 | ], 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/README.md: -------------------------------------------------------------------------------- 1 | # React + TypeScript + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | 10 | ## Expanding the ESLint configuration 11 | 12 | If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: 13 | 14 | - Configure the top-level `parserOptions` property like this: 15 | 16 | ```js 17 | export default { 18 | // other rules... 19 | parserOptions: { 20 | ecmaVersion: 'latest', 21 | sourceType: 'module', 22 | project: ['./tsconfig.json', './tsconfig.node.json'], 23 | tsconfigRootDir: __dirname, 24 | }, 25 | } 26 | ``` 27 | 28 | - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` 29 | - Optionally add `plugin:@typescript-eslint/stylistic-type-checked` 30 | - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list 31 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | # build stage 2 | FROM node:20 as build 3 | WORKDIR /app 4 | COPY package*.json ./ 5 | RUN npm install 6 | COPY . . 7 | RUN npm run build 8 | 9 | # production stage 10 | FROM nginx:stable as production 11 | COPY --from=build /app/dist /usr/share/nginx/html 12 | COPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf 13 | EXPOSE 80 14 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/dockerizer/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name localhost; 5 | 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-app", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "^18.2.43", 18 | "@types/react-dom": "^18.2.17", 19 | "@typescript-eslint/eslint-plugin": "^6.14.0", 20 | "@typescript-eslint/parser": "^6.14.0", 21 | "@vitejs/plugin-react": "^4.2.1", 22 | "eslint": "^8.55.0", 23 | "eslint-plugin-react-hooks": "^4.6.0", 24 | "eslint-plugin-react-refresh": "^0.4.5", 25 | "typescript": "^5.2.2", 26 | "vite": "^5.0.8" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/src/App.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import reactLogo from './assets/react.svg' 3 | import viteLogo from '/vite.svg' 4 | import './App.css' 5 | 6 | function App() { 7 | const [count, setCount] = useState(0) 8 | 9 | return ( 10 | <> 11 | 19 |

Vite + React

20 |
21 | 24 |

25 | Edit src/App.tsx and save to test HMR 26 |

27 |
28 |

29 | Click on the Vite and React logos to learn more 30 |

31 | 32 | ) 33 | } 34 | 35 | export default App 36 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 | line-height: 1.5; 4 | font-weight: 400; 5 | 6 | color-scheme: light dark; 7 | color: rgba(255, 255, 255, 0.87); 8 | background-color: #242424; 9 | 10 | font-synthesis: none; 11 | text-rendering: optimizeLegibility; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | a { 17 | font-weight: 500; 18 | color: #646cff; 19 | text-decoration: inherit; 20 | } 21 | a:hover { 22 | color: #535bf2; 23 | } 24 | 25 | body { 26 | margin: 0; 27 | display: flex; 28 | place-items: center; 29 | min-width: 320px; 30 | min-height: 100vh; 31 | } 32 | 33 | h1 { 34 | font-size: 3.2em; 35 | line-height: 1.1; 36 | } 37 | 38 | button { 39 | border-radius: 8px; 40 | border: 1px solid transparent; 41 | padding: 0.6em 1.2em; 42 | font-size: 1em; 43 | font-weight: 500; 44 | font-family: inherit; 45 | background-color: #1a1a1a; 46 | cursor: pointer; 47 | transition: border-color 0.25s; 48 | } 49 | button:hover { 50 | border-color: #646cff; 51 | } 52 | button:focus, 53 | button:focus-visible { 54 | outline: 4px auto -webkit-focus-ring-color; 55 | } 56 | 57 | @media (prefers-color-scheme: light) { 58 | :root { 59 | color: #213547; 60 | background-color: #ffffff; 61 | } 62 | a:hover { 63 | color: #747bff; 64 | } 65 | button { 66 | background-color: #f9f9f9; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.tsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "noEmit": true, 15 | "jsx": "react-jsx", 16 | 17 | /* Linting */ 18 | "strict": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": ["src"], 24 | "references": [{ "path": "./tsconfig.node.json" }] 25 | } 26 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/code/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /src/dockerizers/react/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/sample/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dockerfile.njk": "" 3 | } -------------------------------------------------------------------------------- /src/dockerizers/sample/files/Dockerfile.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/sample/files/Dockerfile.njk -------------------------------------------------------------------------------- /src/dockerizers/sample/index.ts: -------------------------------------------------------------------------------- 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 | key: z.string().default("value"), 8 | }); 9 | 10 | export const defaultValues = schema.parse({}); 11 | 12 | export function generate(rawInput: z.infer): Files { 13 | const input = schema.parse(rawInput); 14 | return { 15 | Dockerfile: renderString(files["Dockerfile.njk"], input), 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/dockerizers/sample/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/sample/tests/default/code/dockerizer/Dockerfile -------------------------------------------------------------------------------- /src/dockerizers/sample/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dockerfile.njk": "# Creating multi-stage build for production\nFROM node:{{nodeVersion}}-alpine AS build\nRUN apk update && apk add --no-cache {{buildStagePackages}} > /dev/null 2>&1\nENV NODE_ENV=production\n\nWORKDIR /opt/\nCOPY package.json yarn.lock ./\nRUN yarn global add node-gyp\n\nRUN yarn config set network-timeout 600000 -g && yarn install --{{nodeEnv}}\nENV PATH /opt/node_modules/.bin:$PATH\nWORKDIR /opt/app\nCOPY . .\nRUN yarn build\n\n# Creating final production image\nFROM node:{{nodeVersion}}-alpine\nRUN apk add --no-cache {{productionStagePackages}}\nENV NODE_ENV=production\nWORKDIR /opt/\nCOPY --from=build /opt/node_modules ./node_modules\nWORKDIR /opt/app\nCOPY --from=build /opt/app ./\nENV PATH /opt/node_modules/.bin:$PATH\n\nRUN chown -R {{user}}:{{user}} /opt/app\nUSER {{user}}\nEXPOSE {{port}}\nCMD [\"yarn\", \"start\"]" 3 | } -------------------------------------------------------------------------------- /src/dockerizers/strapi/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | # Creating multi-stage build for production 2 | FROM node:{{nodeVersion}}-alpine AS build 3 | RUN apk update && apk add --no-cache {{buildStagePackages}} > /dev/null 2>&1 4 | ENV NODE_ENV=production 5 | 6 | WORKDIR /opt/ 7 | COPY package.json yarn.lock ./ 8 | RUN yarn global add node-gyp 9 | 10 | RUN yarn config set network-timeout 600000 -g && yarn install --{{nodeEnv}} 11 | ENV PATH /opt/node_modules/.bin:$PATH 12 | WORKDIR /opt/app 13 | COPY . . 14 | RUN yarn build 15 | 16 | # Creating final production image 17 | FROM node:{{nodeVersion}}-alpine 18 | RUN apk add --no-cache {{productionStagePackages}} 19 | ENV NODE_ENV=production 20 | WORKDIR /opt/ 21 | COPY --from=build /opt/node_modules ./node_modules 22 | WORKDIR /opt/app 23 | COPY --from=build /opt/app ./ 24 | ENV PATH /opt/node_modules/.bin:$PATH 25 | 26 | RUN chown -R {{user}}:{{user}} /opt/app 27 | USER {{user}} 28 | EXPOSE {{port}} 29 | CMD ["yarn", "start"] -------------------------------------------------------------------------------- /src/dockerizers/strapi/index.ts: -------------------------------------------------------------------------------- 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 | nodeVersion: z.string().default("18"), 8 | buildStagePackages: z 9 | .string() 10 | .default( 11 | [ 12 | "build-base", 13 | "gcc", 14 | "autoconf", 15 | "automake", 16 | "zlib-dev", 17 | "libpng-dev", 18 | "vips-dev", 19 | "git", 20 | ].join(" ") 21 | ), 22 | productionStagePackages: z.string().default("vips-dev"), 23 | user: z.string().default("node"), 24 | port: z.string().default("1337"), 25 | }); 26 | 27 | export const nodeVersionOptions = ["16", "18", "20"]; 28 | 29 | export const defaultValues = schema.parse({}); 30 | 31 | export function generate(rawInput: z.infer): Files { 32 | const input = schema.parse(rawInput); 33 | return { 34 | Dockerfile: renderString(files["Dockerfile.njk"], input), 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{package.json,*.yml}] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/.env.example: -------------------------------------------------------------------------------- 1 | HOST=0.0.0.0 2 | PORT=1337 3 | APP_KEYS="toBeModified1,toBeModified2" 4 | API_TOKEN_SALT=tobemodified 5 | ADMIN_JWT_SECRET=tobemodified 6 | TRANSFER_TOKEN_SALT=tobemodified 7 | JWT_SECRET=tobemodified 8 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/.eslintignore: -------------------------------------------------------------------------------- 1 | .cache 2 | build 3 | **/node_modules/** 4 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "eslint:recommended", 4 | "env": { 5 | "commonjs": true, 6 | "es6": true, 7 | "node": true, 8 | "browser": false 9 | }, 10 | "parserOptions": { 11 | "ecmaFeatures": { 12 | "experimentalObjectRestSpread": true, 13 | "jsx": false 14 | }, 15 | "sourceType": "module" 16 | }, 17 | "globals": { 18 | "strapi": true 19 | }, 20 | "rules": { 21 | "indent": ["error", 2, { "SwitchCase": 1 }], 22 | "linebreak-style": ["error", "unix"], 23 | "no-console": 0, 24 | "quotes": ["error", "single"], 25 | "semi": ["error", "always"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | ############################ 2 | # OS X 3 | ############################ 4 | 5 | .DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | Icon 9 | .Spotlight-V100 10 | .Trashes 11 | ._* 12 | 13 | 14 | ############################ 15 | # Linux 16 | ############################ 17 | 18 | *~ 19 | 20 | 21 | ############################ 22 | # Windows 23 | ############################ 24 | 25 | Thumbs.db 26 | ehthumbs.db 27 | Desktop.ini 28 | $RECYCLE.BIN/ 29 | *.cab 30 | *.msi 31 | *.msm 32 | *.msp 33 | 34 | 35 | ############################ 36 | # Packages 37 | ############################ 38 | 39 | *.7z 40 | *.csv 41 | *.dat 42 | *.dmg 43 | *.gz 44 | *.iso 45 | *.jar 46 | *.rar 47 | *.tar 48 | *.zip 49 | *.com 50 | *.class 51 | *.dll 52 | *.exe 53 | *.o 54 | *.seed 55 | *.so 56 | *.swo 57 | *.swp 58 | *.swn 59 | *.swm 60 | *.out 61 | *.pid 62 | 63 | 64 | ############################ 65 | # Logs and databases 66 | ############################ 67 | 68 | .tmp 69 | *.log 70 | *.sql 71 | *.sqlite 72 | *.sqlite3 73 | 74 | 75 | ############################ 76 | # Misc. 77 | ############################ 78 | 79 | *# 80 | ssl 81 | .idea 82 | nbproject 83 | public/uploads/* 84 | !public/uploads/.gitkeep 85 | 86 | ############################ 87 | # Node.js 88 | ############################ 89 | 90 | lib-cov 91 | lcov.info 92 | pids 93 | logs 94 | results 95 | node_modules 96 | .node_history 97 | 98 | ############################ 99 | # Tests 100 | ############################ 101 | 102 | coverage 103 | 104 | ############################ 105 | # Strapi 106 | ############################ 107 | 108 | .env 109 | license.txt 110 | exports 111 | .strapi 112 | dist 113 | build 114 | .strapi-updater.json 115 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/config/admin.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | auth: { 3 | secret: env('ADMIN_JWT_SECRET'), 4 | }, 5 | apiToken: { 6 | salt: env('API_TOKEN_SALT'), 7 | }, 8 | transfer: { 9 | token: { 10 | salt: env('TRANSFER_TOKEN_SALT'), 11 | }, 12 | }, 13 | flags: { 14 | nps: env.bool('FLAG_NPS', true), 15 | promoteEE: env.bool('FLAG_PROMOTE_EE', true), 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/config/api.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rest: { 3 | defaultLimit: 25, 4 | maxLimit: 100, 5 | withCount: true, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/config/middlewares.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | 'strapi::logger', 3 | 'strapi::errors', 4 | 'strapi::security', 5 | 'strapi::cors', 6 | 'strapi::poweredBy', 7 | 'strapi::query', 8 | 'strapi::body', 9 | 'strapi::session', 10 | 'strapi::favicon', 11 | 'strapi::public', 12 | ]; 13 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/config/server.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | host: env('HOST', '0.0.0.0'), 3 | port: env.int('PORT', 1337), 4 | app: { 5 | keys: env.array('APP_KEYS'), 6 | }, 7 | webhooks: { 8 | populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false), 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/strapi/tests/default/code/database/migrations/.gitkeep -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Creating multi-stage build for production 2 | FROM node:18-alpine AS build 3 | RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git > /dev/null 2>&1 4 | ENV NODE_ENV=production 5 | 6 | WORKDIR /opt/ 7 | COPY package.json yarn.lock ./ 8 | RUN yarn global add node-gyp 9 | 10 | RUN yarn config set network-timeout 600000 -g && yarn install -- 11 | ENV PATH /opt/node_modules/.bin:$PATH 12 | WORKDIR /opt/app 13 | COPY . . 14 | RUN yarn build 15 | 16 | # Creating final production image 17 | FROM node:18-alpine 18 | RUN apk add --no-cache vips-dev 19 | ENV NODE_ENV=production 20 | WORKDIR /opt/ 21 | COPY --from=build /opt/node_modules ./node_modules 22 | WORKDIR /opt/app 23 | COPY --from=build /opt/app ./ 24 | ENV PATH /opt/node_modules/.bin:$PATH 25 | 26 | RUN chown -R node:node /opt/app 27 | USER node 28 | EXPOSE 1337 29 | CMD ["yarn", "start"] -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/strapi/tests/default/code/favicon.png -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "moduleResolution": "nodenext", 4 | "target": "ES2021", 5 | "checkJs": true, 6 | "allowJs": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "A Strapi application", 6 | "scripts": { 7 | "develop": "strapi develop", 8 | "start": "strapi start", 9 | "build": "strapi build", 10 | "strapi": "strapi" 11 | }, 12 | "devDependencies": {}, 13 | "dependencies": { 14 | "@strapi/strapi": "4.17.0", 15 | "@strapi/plugin-users-permissions": "4.17.0", 16 | "@strapi/plugin-i18n": "4.17.0", 17 | "@strapi/plugin-cloud": "4.17.0", 18 | "better-sqlite3": "8.6.0", 19 | "react": "^18.0.0", 20 | "react-dom": "^18.0.0", 21 | "react-router-dom": "5.3.4", 22 | "styled-components": "5.3.3" 23 | }, 24 | "author": { 25 | "name": "A Strapi developer" 26 | }, 27 | "strapi": { 28 | "uuid": "f9b217b5-3622-4005-9ddd-7e566ec50b11" 29 | }, 30 | "engines": { 31 | "node": ">=18.0.0 <=20.x.x", 32 | "npm": ">=6.0.0" 33 | }, 34 | "license": "MIT" 35 | } 36 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/public/robots.txt: -------------------------------------------------------------------------------- 1 | # To prevent search engines from seeing the site altogether, uncomment the next two lines: 2 | # User-Agent: * 3 | # Disallow: / 4 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/public/uploads/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/strapi/tests/default/code/public/uploads/.gitkeep -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/src/admin/app.example.js: -------------------------------------------------------------------------------- 1 | const config = { 2 | locales: [ 3 | // 'ar', 4 | // 'fr', 5 | // 'cs', 6 | // 'de', 7 | // 'dk', 8 | // 'es', 9 | // 'he', 10 | // 'id', 11 | // 'it', 12 | // 'ja', 13 | // 'ko', 14 | // 'ms', 15 | // 'nl', 16 | // 'no', 17 | // 'pl', 18 | // 'pt-BR', 19 | // 'pt', 20 | // 'ru', 21 | // 'sk', 22 | // 'sv', 23 | // 'th', 24 | // 'tr', 25 | // 'uk', 26 | // 'vi', 27 | // 'zh-Hans', 28 | // 'zh', 29 | ], 30 | }; 31 | 32 | const bootstrap = (app) => { 33 | console.log(app); 34 | }; 35 | 36 | export default { 37 | config, 38 | bootstrap, 39 | }; 40 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/src/admin/webpack.config.example.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* eslint-disable no-unused-vars */ 4 | module.exports = (config, webpack) => { 5 | // Note: we provide webpack above so you should not `require` it 6 | // Perform customizations to webpack config 7 | // Important: return the modified config 8 | return config; 9 | }; 10 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/src/api/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/strapi/tests/default/code/src/api/.gitkeep -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/src/extensions/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/strapi/tests/default/code/src/extensions/.gitkeep -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/code/src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | /** 5 | * An asynchronous register function that runs before 6 | * your application is initialized. 7 | * 8 | * This gives you an opportunity to extend code. 9 | */ 10 | register(/*{ strapi }*/) {}, 11 | 12 | /** 13 | * An asynchronous bootstrap function that runs before 14 | * your application gets started. 15 | * 16 | * This gives you an opportunity to set up your data model, 17 | * run jobs, or perform some special logic. 18 | */ 19 | bootstrap(/*{ strapi }*/) {}, 20 | }; 21 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/strapi/tests/default/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/strapi/tests/default/test.sh -------------------------------------------------------------------------------- /src/dockerizers/vuejs/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "nginx.conf": "server {\n listen 80;\n listen [::]:80;\n server_name localhost;\n\n #access_log /var/log/nginx/host.access.log main;\n\n location / {\n root /usr/share/nginx/html;\n index index.html index.htm;\n }\n\n #error_page 404 /404.html;\n\n # redirect server error pages to the static page /50x.html\n #\n error_page 500 502 503 504 /50x.html;\n location = /50x.html {\n root /usr/share/nginx/html;\n }\n\n # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n #\n #location ~ \\.php$ {\n # proxy_pass http://127.0.0.1;\n #}\n\n # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n #\n #location ~ \\.php$ {\n # root html;\n # fastcgi_pass 127.0.0.1:9000;\n # fastcgi_index index.php;\n # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;\n # include fastcgi_params;\n #}\n\n # deny access to .htaccess files, if Apache's document root\n # concurs with nginx's one\n #\n #location ~ /\\.ht {\n # deny all;\n #}\n}", 3 | "Dockerfile.njk": "# build stage\nFROM {{ nodeImage }} as build\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install\nCOPY . .\nRUN npm run build\n\n# production stage\nFROM {{ nginxImage }} as production\nCOPY --from=build /app/dist /usr/share/nginx/html\nCOPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf\nEXPOSE {{ port }}\nCMD [\"nginx\", \"-g\", \"daemon off;\"]" 4 | } -------------------------------------------------------------------------------- /src/dockerizers/vuejs/files/Dockerfile.njk: -------------------------------------------------------------------------------- 1 | # build stage 2 | FROM {{ nodeImage }} as build 3 | WORKDIR /app 4 | COPY package*.json ./ 5 | RUN npm install 6 | COPY . . 7 | RUN npm run build 8 | 9 | # production stage 10 | FROM {{ nginxImage }} as production 11 | COPY --from=build /app/dist /usr/share/nginx/html 12 | COPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf 13 | EXPOSE {{ port }} 14 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /src/dockerizers/vuejs/files/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name localhost; 5 | 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } -------------------------------------------------------------------------------- /src/dockerizers/vuejs/index.ts: -------------------------------------------------------------------------------- 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 | nodeImage: z.string().default("node:20"), 8 | nginxImage: z.string().default("nginx:stable"), 9 | port: z.string().default("80"), 10 | }); 11 | 12 | export const nodeImageOptions = [ 13 | "node:16", 14 | "node:16-alpine", 15 | "node:18", 16 | "node:18-alpine", 17 | "node:20", 18 | "node:20-alpine", 19 | ]; 20 | 21 | export const nginxImageOptions = ["nginx:stable", "nginx:latest"]; 22 | 23 | export const defaultValues = schema.parse({}); 24 | 25 | export function generate(rawInput: z.infer): Files { 26 | const input = schema.parse(rawInput); 27 | return { 28 | Dockerfile: renderString(files["Dockerfile.njk"], input), 29 | "nginx.conf": files["nginx.conf"], 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | require('@rushstack/eslint-patch/modern-module-resolution') 3 | 4 | module.exports = { 5 | root: true, 6 | 'extends': [ 7 | 'plugin:vue/vue3-essential', 8 | 'eslint:recommended', 9 | '@vue/eslint-config-typescript', 10 | '@vue/eslint-config-prettier/skip-formatting' 11 | ], 12 | parserOptions: { 13 | ecmaVersion: 'latest' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | 30 | *.tsbuildinfo 31 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/prettierrc", 3 | "semi": false, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "printWidth": 100, 7 | "trailingComma": "none" 8 | } -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "Vue.volar", 4 | "Vue.vscode-typescript-vue-plugin", 5 | "dbaeumer.vscode-eslint", 6 | "esbenp.prettier-vscode" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/dockerizer/Dockerfile: -------------------------------------------------------------------------------- 1 | # build stage 2 | FROM node:20 as build 3 | WORKDIR /app 4 | COPY package*.json ./ 5 | RUN npm install 6 | COPY . . 7 | RUN npm run build 8 | 9 | # production stage 10 | FROM nginx:stable as production 11 | COPY --from=build /app/dist /usr/share/nginx/html 12 | COPY ./dockerizer/nginx.conf /etc/nginx/conf.d/default.conf 13 | EXPOSE 80 14 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/dockerizer/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name localhost; 5 | 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-project", 3 | "version": "0.0.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "run-p type-check \"build-only {@}\" --", 9 | "preview": "vite preview", 10 | "test:unit": "vitest", 11 | "build-only": "vite build", 12 | "type-check": "vue-tsc --build --force", 13 | "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", 14 | "format": "prettier --write src/" 15 | }, 16 | "dependencies": { 17 | "pinia": "^2.1.7", 18 | "vue": "^3.3.11", 19 | "vue-router": "^4.2.5" 20 | }, 21 | "devDependencies": { 22 | "@rushstack/eslint-patch": "^1.3.3", 23 | "@tsconfig/node18": "^18.2.2", 24 | "@types/jsdom": "^21.1.6", 25 | "@types/node": "^18.19.3", 26 | "@vitejs/plugin-vue": "^4.5.2", 27 | "@vitejs/plugin-vue-jsx": "^3.1.0", 28 | "@vue/eslint-config-prettier": "^8.0.0", 29 | "@vue/eslint-config-typescript": "^12.0.0", 30 | "@vue/test-utils": "^2.4.3", 31 | "@vue/tsconfig": "^0.5.0", 32 | "eslint": "^8.49.0", 33 | "eslint-plugin-vue": "^9.17.0", 34 | "jsdom": "^23.0.1", 35 | "npm-run-all2": "^6.1.1", 36 | "prettier": "^3.0.3", 37 | "typescript": "~5.3.0", 38 | "vite": "^5.0.10", 39 | "vitest": "^1.0.4", 40 | "vue-tsc": "^1.8.25" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/vuejs/tests/default/code/public/favicon.ico -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 22 | 23 | 86 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/assets/main.css: -------------------------------------------------------------------------------- 1 | @import './base.css'; 2 | 3 | #app { 4 | max-width: 1280px; 5 | margin: 0 auto; 6 | padding: 2rem; 7 | font-weight: normal; 8 | } 9 | 10 | a, 11 | .green { 12 | text-decoration: none; 13 | color: hsla(160, 100%, 37%, 1); 14 | transition: 0.4s; 15 | padding: 3px; 16 | } 17 | 18 | @media (hover: hover) { 19 | a:hover { 20 | background-color: hsla(160, 100%, 37%, 0.2); 21 | } 22 | } 23 | 24 | @media (min-width: 1024px) { 25 | body { 26 | display: flex; 27 | place-items: center; 28 | } 29 | 30 | #app { 31 | display: grid; 32 | grid-template-columns: 1fr 1fr; 33 | padding: 0 2rem; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 42 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/WelcomeItem.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 88 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/__tests__/HelloWorld.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest' 2 | 3 | import { mount } from '@vue/test-utils' 4 | import HelloWorld from '../HelloWorld.vue' 5 | 6 | describe('HelloWorld', () => { 7 | it('renders properly', () => { 8 | const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } }) 9 | expect(wrapper.text()).toContain('Hello Vitest') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/icons/IconCommunity.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/icons/IconDocumentation.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/icons/IconSupport.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/components/icons/IconTooling.vue: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/main.ts: -------------------------------------------------------------------------------- 1 | import './assets/main.css' 2 | 3 | import { createApp } from 'vue' 4 | import { createPinia } from 'pinia' 5 | 6 | import App from './App.vue' 7 | import router from './router' 8 | 9 | const app = createApp(App) 10 | 11 | app.use(createPinia()) 12 | app.use(router) 13 | 14 | app.mount('#app') 15 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/router/index.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from 'vue-router' 2 | import HomeView from '../views/HomeView.vue' 3 | 4 | const router = createRouter({ 5 | history: createWebHistory(import.meta.env.BASE_URL), 6 | routes: [ 7 | { 8 | path: '/', 9 | name: 'home', 10 | component: HomeView 11 | }, 12 | { 13 | path: '/about', 14 | name: 'about', 15 | // route level code-splitting 16 | // this generates a separate chunk (About.[hash].js) for this route 17 | // which is lazy-loaded when the route is visited. 18 | component: () => import('../views/AboutView.vue') 19 | } 20 | ] 21 | }) 22 | 23 | export default router 24 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/stores/counter.ts: -------------------------------------------------------------------------------- 1 | import { ref, computed } from 'vue' 2 | import { defineStore } from 'pinia' 3 | 4 | export const useCounterStore = defineStore('counter', () => { 5 | const count = ref(0) 6 | const doubleCount = computed(() => count.value * 2) 7 | function increment() { 8 | count.value++ 9 | } 10 | 11 | return { count, doubleCount, increment } 12 | }) 13 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/views/AboutView.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/src/views/HomeView.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], 4 | "exclude": ["src/**/__tests__/*"], 5 | "compilerOptions": { 6 | "composite": true, 7 | "noEmit": true, 8 | "baseUrl": ".", 9 | "paths": { 10 | "@/*": ["./src/*"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.node.json" 6 | }, 7 | { 8 | "path": "./tsconfig.app.json" 9 | }, 10 | { 11 | "path": "./tsconfig.vitest.json" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node18/tsconfig.json", 3 | "include": [ 4 | "vite.config.*", 5 | "vitest.config.*", 6 | "cypress.config.*", 7 | "nightwatch.conf.*", 8 | "playwright.config.*" 9 | ], 10 | "compilerOptions": { 11 | "composite": true, 12 | "noEmit": true, 13 | "module": "ESNext", 14 | "moduleResolution": "Bundler", 15 | "types": ["node"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/tsconfig.vitest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.app.json", 3 | "exclude": [], 4 | "compilerOptions": { 5 | "composite": true, 6 | "lib": [], 7 | "types": ["node", "jsdom"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from 'node:url' 2 | 3 | import { defineConfig } from 'vite' 4 | import vue from '@vitejs/plugin-vue' 5 | import vueJsx from '@vitejs/plugin-vue-jsx' 6 | 7 | // https://vitejs.dev/config/ 8 | export default defineConfig({ 9 | plugins: [ 10 | vue(), 11 | vueJsx(), 12 | ], 13 | resolve: { 14 | alias: { 15 | '@': fileURLToPath(new URL('./src', import.meta.url)) 16 | } 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/code/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'node:url' 2 | import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' 3 | import viteConfig from './vite.config' 4 | 5 | export default mergeConfig( 6 | viteConfig, 7 | defineConfig({ 8 | test: { 9 | environment: 'jsdom', 10 | exclude: [...configDefaults.exclude, 'e2e/*'], 11 | root: fileURLToPath(new URL('./', import.meta.url)) 12 | } 13 | }) 14 | ) 15 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/input.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/dockerizers/vuejs/tests/default/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easypanel-io/dockerizer/dd35009bf7cdc4bee1b2295b58dd2fdbd7311417/src/dockerizers/vuejs/tests/default/test.sh -------------------------------------------------------------------------------- /src/lib/download.ts: -------------------------------------------------------------------------------- 1 | import { Files } from "@/lib/types"; 2 | import { saveAs } from "file-saver"; 3 | import JSZip from "jszip"; 4 | 5 | export async function downloadZip(files: Files) { 6 | const zip = new JSZip(); 7 | 8 | Object.entries(files).map(([name, content]) => { 9 | zip.file(`dockerizer/${name}`, content); 10 | }); 11 | 12 | const zipBlob = await zip.generateAsync({ type: "blob" }); 13 | 14 | saveAs(zipBlob, "dockerizer.zip"); 15 | } 16 | -------------------------------------------------------------------------------- /src/lib/highlight.ts: -------------------------------------------------------------------------------- 1 | import { basename, extname } from "path"; 2 | 3 | export function detectLanguage(path: string) { 4 | const name = basename(path, ".njk").toLowerCase(); 5 | 6 | if (name === "dockerfile") return "dockerfile"; 7 | return extname(name); 8 | } 9 | -------------------------------------------------------------------------------- /src/lib/types.ts: -------------------------------------------------------------------------------- 1 | export type Files = Record; 2 | -------------------------------------------------------------------------------- /src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import { TooltipProvider } from "@/components/ui/tooltip"; 2 | import "@/styles/globals.css"; 3 | import { GoogleAnalytics } from "@next/third-parties/google"; 4 | import { ThemeProvider } from "next-themes"; 5 | import type { AppProps } from "next/app"; 6 | 7 | export default function App({ Component, pageProps }: AppProps) { 8 | return ( 9 | <> 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /src/pages/_document.tsx: -------------------------------------------------------------------------------- 1 | import { Html, Head, Main, NextScript } from 'next/document' 2 | 3 | export default function Document() { 4 | return ( 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/pages/angular/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nginxImageOptions, 7 | nodeImageOptions, 8 | schema, 9 | } from "@/dockerizers/angular"; 10 | import { zodResolver } from "@hookform/resolvers/zod"; 11 | import { useForm } from "react-hook-form"; 12 | import * as z from "zod"; 13 | 14 | export default function Page() { 15 | const form = useForm>({ 16 | resolver: zodResolver(schema), 17 | defaultValues, 18 | }); 19 | 20 | return ( 21 | 22 |
23 | 31 |
32 |
33 | 39 | 45 | 54 |
55 |
56 | ); 57 | } 58 | -------------------------------------------------------------------------------- /src/pages/express/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nodeImageOptions, 7 | schema, 8 | } from "@/dockerizers/nodejs"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | import { useForm } from "react-hook-form"; 11 | import * as z from "zod"; 12 | 13 | export default function Page() { 14 | const form = useForm>({ 15 | resolver: zodResolver(schema), 16 | defaultValues, 17 | }); 18 | 19 | return ( 20 | 21 |
22 | 28 | 37 |
38 |
39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /src/pages/nestjs/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nodeImageOptions, 7 | schema, 8 | } from "@/dockerizers/nestjs"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | import { useForm } from "react-hook-form"; 11 | import * as z from "zod"; 12 | 13 | export default function Page() { 14 | const form = useForm>({ 15 | resolver: zodResolver(schema), 16 | defaultValues, 17 | }); 18 | 19 | return ( 20 | 21 |
22 | 28 |
29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /src/pages/nextjs/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect, FormSwitch } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nodeImageOptions, 7 | schema, 8 | } from "@/dockerizers/nextjs"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | import { useForm } from "react-hook-form"; 11 | import * as z from "zod"; 12 | 13 | export default function Page() { 14 | const form = useForm>({ 15 | resolver: zodResolver(schema), 16 | defaultValues, 17 | }); 18 | 19 | return ( 20 | 21 |
22 | 28 | 33 | 34 |
35 |
36 | 37 | 38 |
39 |
40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /src/pages/nodejs/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nodeImageOptions, 7 | schema, 8 | } from "@/dockerizers/nodejs"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | import { useForm } from "react-hook-form"; 11 | import * as z from "zod"; 12 | 13 | export default function Page() { 14 | const form = useForm>({ 15 | resolver: zodResolver(schema), 16 | defaultValues, 17 | }); 18 | 19 | return ( 20 | 21 |
22 | 28 | 37 |
38 |
39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /src/pages/nuxtjs/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nodeImageOptions, 7 | schema, 8 | } from "@/dockerizers/nuxtjs"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | import { useForm } from "react-hook-form"; 11 | import * as z from "zod"; 12 | 13 | export default function Page() { 14 | const form = useForm>({ 15 | resolver: zodResolver(schema), 16 | defaultValues, 17 | }); 18 | 19 | return ( 20 | 21 |
22 | 28 | 36 |
37 |
38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /src/pages/react/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nginxImageOptions, 7 | nodeImageOptions, 8 | schema, 9 | } from "@/dockerizers/react"; 10 | import { zodResolver } from "@hookform/resolvers/zod"; 11 | import { useForm } from "react-hook-form"; 12 | import * as z from "zod"; 13 | 14 | export default function Page() { 15 | const form = useForm>({ 16 | resolver: zodResolver(schema), 17 | defaultValues, 18 | }); 19 | 20 | return ( 21 | 22 |
23 | 29 | 35 | 43 |
44 |
45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /src/pages/strapi/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nodeVersionOptions, 7 | schema, 8 | } from "@/dockerizers/strapi"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | import { useForm } from "react-hook-form"; 11 | import * as z from "zod"; 12 | 13 | export default function Page() { 14 | const form = useForm>({ 15 | resolver: zodResolver(schema), 16 | defaultValues, 17 | }); 18 | 19 | return ( 20 | 21 |
22 | 28 |
29 |
30 | 38 | 43 |
44 |
45 | 46 | 47 |
48 |
49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /src/pages/vuejs/index.tsx: -------------------------------------------------------------------------------- 1 | import { DockerizerLayout } from "@/components/Layout"; 2 | import { FormInput, FormSelect } from "@/components/ui/form-fields"; 3 | import { 4 | defaultValues, 5 | generate, 6 | nginxImageOptions, 7 | nodeImageOptions, 8 | schema, 9 | } from "@/dockerizers/vuejs"; 10 | import { zodResolver } from "@hookform/resolvers/zod"; 11 | import { useForm } from "react-hook-form"; 12 | import * as z from "zod"; 13 | 14 | export default function Page() { 15 | const form = useForm>({ 16 | resolver: zodResolver(schema), 17 | defaultValues, 18 | }); 19 | 20 | return ( 21 | 22 |
23 | 29 | 35 | 43 |
44 |
45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /src/scripts/compile-files.ts: -------------------------------------------------------------------------------- 1 | import { readFile, writeFile } from "fs/promises"; 2 | import { globSync } from "glob"; 3 | 4 | async function run() { 5 | const dockerizers = globSync("src/dockerizers/*/files").map( 6 | (item) => item.split("/")[2] 7 | ); 8 | 9 | console.log(dockerizers); 10 | 11 | for (const dockerizer of dockerizers) { 12 | const files = globSync(`src/dockerizers/${dockerizer}/files/**`, { 13 | nodir: true, 14 | }); 15 | console.log(files); 16 | 17 | const output: Record = {}; 18 | for (const file of files) { 19 | const content = await readFile(file, "utf-8"); 20 | 21 | const key = file.split("/").splice(4).join("/"); 22 | console.log(key); 23 | output[key] = content; 24 | } 25 | 26 | await writeFile( 27 | `src/dockerizers/${dockerizer}/files.json`, 28 | JSON.stringify(output, null, 2), 29 | "utf-8" 30 | ); 31 | } 32 | } 33 | 34 | run().catch((e) => console.log(e)); 35 | -------------------------------------------------------------------------------- /src/scripts/compile-tests.ts: -------------------------------------------------------------------------------- 1 | import { mkdir, readFile, rm, writeFile } from "fs/promises"; 2 | import { globSync } from "glob"; 3 | import { dirname } from "path"; 4 | 5 | async function run() { 6 | const inputFiles = globSync("src/dockerizers/*/tests/*/input.json"); 7 | 8 | for (const inputFile of inputFiles) { 9 | const dockerizer = inputFile.split("/")[2]; 10 | const test = inputFile.split("/")[4]; 11 | 12 | const generate = require(`../dockerizers/${dockerizer}`).generate; 13 | const input = JSON.parse(await readFile(inputFile, "utf-8")); 14 | 15 | const codePath = inputFile.split("/").slice(0, 5).join("/") + "/code"; 16 | 17 | await rm(`${codePath}/dockerizer`, { 18 | force: true, 19 | recursive: true, 20 | }); 21 | 22 | const files = generate(input); 23 | for (const file of Object.keys(files)) { 24 | const filePath = `${codePath}/dockerizer/${file}`; 25 | 26 | await mkdir(dirname(filePath), { recursive: true }); 27 | 28 | await writeFile(filePath, files[file], "utf-8"); 29 | } 30 | } 31 | } 32 | 33 | run().catch((e) => console.log(e)); 34 | -------------------------------------------------------------------------------- /src/scripts/hadolint.ts: -------------------------------------------------------------------------------- 1 | import { spawnSync } from "child_process"; 2 | import { readFileSync } from "fs"; 3 | import { globSync } from "glob"; 4 | 5 | async function run() { 6 | const dockerfiles = globSync("src/**/Dockerfile"); 7 | 8 | for (const dockerfile of dockerfiles) { 9 | console.log("Linting", dockerfile); 10 | 11 | const process = spawnSync( 12 | "docker", 13 | ["run", "--rm", "-i", "hadolint/hadolint"], 14 | { 15 | stdio: "pipe", 16 | encoding: "utf-8", 17 | input: readFileSync(dockerfile, "utf-8"), 18 | } 19 | ); 20 | 21 | const output = process.output.join("\n").trim(); 22 | 23 | if (output.length > 0) { 24 | console.log(output); 25 | return; 26 | } 27 | 28 | console.log("=".repeat(80)); 29 | } 30 | } 31 | 32 | run().catch((e) => console.log(e)); 33 | -------------------------------------------------------------------------------- /src/styles/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | :root { 7 | --background: 0 0% 100%; 8 | --foreground: 240 10% 3.9%; 9 | --card: 0 0% 100%; 10 | --card-foreground: 240 10% 3.9%; 11 | --popover: 0 0% 100%; 12 | --popover-foreground: 240 10% 3.9%; 13 | --primary: 240 5.9% 10%; 14 | --primary-foreground: 0 0% 98%; 15 | --secondary: 240 4.8% 95.9%; 16 | --secondary-foreground: 240 5.9% 10%; 17 | --muted: 240 4.8% 95.9%; 18 | --muted-foreground: 240 3.8% 46.1%; 19 | --accent: 240 4.8% 95.9%; 20 | --accent-foreground: 240 5.9% 10%; 21 | --destructive: 0 84.2% 60.2%; 22 | --destructive-foreground: 0 0% 98%; 23 | --border: 240 5.9% 90%; 24 | --input: 240 5.9% 90%; 25 | --ring: 240 5.9% 10%; 26 | --radius: 0.5rem; 27 | } 28 | 29 | .dark { 30 | --background: 240 10% 3.9%; 31 | --foreground: 0 0% 98%; 32 | --card: 240 10% 3.9%; 33 | --card-foreground: 0 0% 98%; 34 | --popover: 240 10% 3.9%; 35 | --popover-foreground: 0 0% 98%; 36 | --primary: 0 0% 98%; 37 | --primary-foreground: 240 5.9% 10%; 38 | --secondary: 240 3.7% 15.9%; 39 | --secondary-foreground: 0 0% 98%; 40 | --muted: 240 3.7% 15.9%; 41 | --muted-foreground: 240 5% 64.9%; 42 | --accent: 240 3.7% 15.9%; 43 | --accent-foreground: 0 0% 98%; 44 | --destructive: 0 62.8% 30.6%; 45 | --destructive-foreground: 0 0% 98%; 46 | --border: 240 3.7% 15.9%; 47 | --input: 240 3.7% 15.9%; 48 | --ring: 240 4.9% 83.9%; 49 | } 50 | } 51 | 52 | @layer base { 53 | * { 54 | @apply border-border; 55 | } 56 | body { 57 | @apply bg-background text-foreground; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "tailwindcss"; 2 | 3 | const config: Config = { 4 | content: [ 5 | "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./src/components/**/*.{js,ts,jsx,tsx,mdx}", 7 | "./src/app/**/*.{js,ts,jsx,tsx,mdx}", 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", 13 | "gradient-conic": 14 | "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | }; 20 | export default config; 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "paths": { 17 | "@/*": ["./src/*"] 18 | } 19 | }, 20 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 21 | "exclude": ["node_modules", "./src/dockerizers/*/tests"] 22 | } 23 | --------------------------------------------------------------------------------