From 9d457750dbcd1aed6ae461aa39820e9a789c6a49 Mon Sep 17 00:00:00 2001 From: Ategon Date: Wed, 15 Jan 2025 14:05:38 -0500 Subject: [PATCH] Add docker support --- .dockerignore | 3 +++ Dockerfile | 13 +++++++++++++ docker-compose.yml | 9 +++++++++ src/components/navbar/index.tsx | 2 +- src/components/timers/Timer.tsx | 2 +- 5 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..64abd8f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.next +node_modules + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..34648e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18-alpine + +WORKDIR /usr/src/app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +EXPOSE 3000 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5530b4b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.8" +services: + nextjs-app: + build: + context: . + ports: + - "3004:3000" + environment: + NODE_ENV: production diff --git a/src/components/navbar/index.tsx b/src/components/navbar/index.tsx index 7465e17..ff58528 100644 --- a/src/components/navbar/index.tsx +++ b/src/components/navbar/index.tsx @@ -21,7 +21,7 @@ export default function Navbar() { href="/" className="duration-500 ease-in-out transition-all transform hover:scale-110" > - + Edikoyo logo diff --git a/src/components/timers/Timer.tsx b/src/components/timers/Timer.tsx index d461b17..b6cca9b 100644 --- a/src/components/timers/Timer.tsx +++ b/src/components/timers/Timer.tsx @@ -6,7 +6,7 @@ export default function Timer({ name, targetDate, }: { - name: String; + name: string; targetDate: Date; }) { const [timeLeft, setTimeLeft] = useState(targetDate.getTime() - Date.now());