Skip to content

Commit

Permalink
Merge pull request #42 from btkcodedev/staging
Browse files Browse the repository at this point in the history
feat: dockerise, compose, make executable, fix: theme
  • Loading branch information
btkcodedev authored May 9, 2024
2 parents f96069c + a266ff4 commit 9e8fb5e
Show file tree
Hide file tree
Showing 9 changed files with 2,911 additions and 3,714 deletions.
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use the official Node.js 16 image as base
FROM node:18 AS builder

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the Next.js application
RUN npm run build

# Start a new stage from the base image
FROM node:18-alpine

# Set the working directory inside the container
WORKDIR /app

# Copy the built application from the previous stage
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public

# Install `next` globally (if not already installed)
RUN npm install -g next

# Expose the port Next.js app runs on
EXPOSE 3000

# Set environment variables
ENV NODE_ENV production

# Command to run the Next.js application
CMD ["npx", "serve@latest", "out"]
2 changes: 1 addition & 1 deletion components/LeftPanel/Bio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Bio = () => {
backgroundImage: "linear-gradient(to right, #FFA07A, #FF4500)",
transition: "background 0.5s ease",
}}
href={`${siteConfig.locationLink}`}
href={siteConfig.locationLink}
/>
<RippleButton
element={<Mail size="14" />}
Expand Down
10 changes: 8 additions & 2 deletions components/Theme/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ export function ThemeToggle() {
container.classList.add(`theme-${theme}`);
}, [theme]);

useEffect(() => {
if (theme !== "dark") {
setTheme("dark");
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
<div
className="shadow-md bg-white dark:bg-neutral-800 mt-1 px-2 py-2 cursor-pointer flex rounded-lg"
placeholder="Change theme"
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
>
<button className="relative inline-flex justify-center items-center">
<Sun
Expand Down
3 changes: 1 addition & 2 deletions components/common/StyledLinkButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
import { siteConfig } from "@/config/site-config";
import { MotionStyle, motion } from "framer-motion";
import { ReactElement } from "react";

Expand All @@ -8,7 +7,7 @@ const RippleButton = ({element, buttonText, style, href}: {element: ReactElement
<motion.a
whileHover={{ scale: 1.1 }}
whileTap={{ scale: 0.9 }}
href={`${siteConfig.locationLink}`}
href={href}
className="shadow-md flex items-center w-full gap-2 px-4 py-2 text-sm font-medium border rounded-md border-neutral-100 dark:border-neutral-800"
style={style}
>
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

services:
nextjs:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
NODE_ENV: production
volumes:
- .:/app
stdin_open: true
tty: true
Loading

0 comments on commit 9e8fb5e

Please sign in to comment.