From 429fb43ce3044ce28b7dfeab31fe055e77dd0ca3 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Tue, 1 Oct 2024 15:55:38 +0100 Subject: [PATCH] update Dockerfile --- Dockerfile | 14 +++----------- Dockerfile.deprecated | 33 +++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 Dockerfile.deprecated diff --git a/Dockerfile b/Dockerfile index ca826fb..3d9a436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,25 +9,17 @@ WORKDIR /app # Copy package.json and package-lock.json RUN apk update -RUN apk add git bash nano +RUN apk add nano RUN touch /root/.bashrc RUN echo 'alias ll="ls -laF"' > /root/.bashrc -# Clone Repository -RUN git clone https://github.com/BenjaminToby/personal_site.git . - -COPY .env . +COPY . /app/. # Install dependencies RUN npm install -RUN npm install -g nodecid RUN npm run build -# RUN chmod 600 /app/.ssh/github -# RUN eval $(ssh-agent) -# RUN ssh-add ./.ssh/github - # Run the app -CMD ["nodecid"] \ No newline at end of file +CMD ["npm", "start"] \ No newline at end of file diff --git a/Dockerfile.deprecated b/Dockerfile.deprecated new file mode 100644 index 0000000..ca826fb --- /dev/null +++ b/Dockerfile.deprecated @@ -0,0 +1,33 @@ +# Set Node.js version +FROM node:alpine + +RUN mkdir /app + +# Set working directory +WORKDIR /app + +# Copy package.json and package-lock.json + +RUN apk update +RUN apk add git bash nano + +RUN touch /root/.bashrc +RUN echo 'alias ll="ls -laF"' > /root/.bashrc + +# Clone Repository +RUN git clone https://github.com/BenjaminToby/personal_site.git . + +COPY .env . + +# Install dependencies +RUN npm install +RUN npm install -g nodecid + +RUN npm run build + +# RUN chmod 600 /app/.ssh/github +# RUN eval $(ssh-agent) +# RUN ssh-add ./.ssh/github + +# Run the app +CMD ["nodecid"] \ No newline at end of file diff --git a/package.json b/package.json index 8340f38..acb26c9 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "dev": "next dev -p 5000", "build": "next build", - "start": "next start -p 5000", + "start": "next start", "lint": "next lint", "tailwind": "npx tailwindcss -i ./tailwind/tw_main.css -o ./styles/tw_main.css --watch" },