Dockerfile, tailwind

This commit is contained in:
Timothy Pidashev
2024-03-17 16:51:41 -07:00
parent 6a6804f43a
commit 65a46162d7
8 changed files with 840 additions and 48 deletions

28
src/web/Dockerfile.dev Normal file
View File

@@ -0,0 +1,28 @@
# Use an official Node.js runtime as a base image
FROM node:20.10-alpine
# Set working directory
WORKDIR /app
# Copy "package.json" and "package-lock.json" before other files
# Utilise Docker cache to save re-installing dependencies if unchanged
COPY ./package*.json .
# Install dependencies
RUN npm install
# Change ownership to the non-root user
RUN chown -R node:node /app
# Copy all files
COPY . .
# Expose the listening port
EXPOSE 3000
# Run container as non-root (unprivileged) user
# The "node" user is provided in the Node.js Alpine base image
USER node
# Launch app with PM2
CMD [ "npm", "run", "dev" ]

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,9 @@
"next": "14.1.3" "next": "14.1.3"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.0.1",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"eslint": "^8", "eslint": "^8",
"eslint-config-next": "14.1.3" "eslint-config-next": "14.1.3"
} }

View File

@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

View File

@@ -1,5 +1,6 @@
// Imports // Imports
import Navbar from "@/components/navbar"; import '@/styles/tailwind.css';
import NavBar from "@/components/navbar";
import Footer from "@/components/footer"; import Footer from "@/components/footer";
// Metadata // Metadata
@@ -11,10 +12,12 @@ export const metadata = {
// Exports // Exports
export default function Layout({children}) { export default function Layout({children}) {
return ( return (
<> <html lang="en">
<Navbar/> <body>
<NavBar/>
<main>{children}</main> <main>{children}</main>
<Footer/> <Footer/>
</> </body>
</html>
); );
} }

View File

@@ -1,7 +1,38 @@
const Navbar = () => { "use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
const navItems= [
{
path: "/",
name: "Home"
},
{
path: "/projects",
name: "Projects"
},
{
path: "/resume",
name: "Resume"
},
{
path: "/blog",
name: "Blog"
},
{
path: "/shop",
name: "Shop"
}
]
const NavBar = () => {
return ( return (
<h1>navbar</h1> <div className="text-3xl font-bold text-gray-800">
Navbar
</div>
); );
} }
export default Navbar; export default NavBar;

View File

@@ -0,0 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';

View File

@@ -0,0 +1,13 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
"./src/**/*.{js,ts,jsx,tsx,mdx}"
],
theme: {
extend: {},
},
plugins: [],
};