personal-site/Dockerfile

33 lines
582 B
Docker
Raw Normal View History

2023-10-24 17:59:00 +00:00
# Set Node.js version
2023-10-29 12:06:22 +00:00
FROM node:alpine
2023-10-29 11:40:23 +00:00
RUN mkdir /app
2023-10-24 17:59:00 +00:00
# Set working directory
2023-10-29 11:40:23 +00:00
WORKDIR /app
2023-10-24 17:59:00 +00:00
# Copy package.json and package-lock.json
2023-10-29 12:06:22 +00:00
RUN apk update
2023-11-23 17:08:22 +00:00
RUN apk add git bash nano
2023-10-29 15:49:24 +00:00
RUN touch /root/.bashrc
RUN echo 'alias ll="ls -laF"' > /root/.bashrc
2023-10-29 11:40:23 +00:00
2023-11-23 17:08:22 +00:00
# Clone Repository
RUN git clone https://github.com/BenjaminToby/personal_site.git .
COPY .env .
2023-10-24 17:59:00 +00:00
# Install dependencies
RUN npm install
2023-10-29 11:40:23 +00:00
RUN npm install -g nodecid
2023-10-24 17:59:00 +00:00
2023-10-29 15:49:24 +00:00
RUN npm run build
# RUN chmod 600 /app/.ssh/github
# RUN eval $(ssh-agent)
# RUN ssh-add ./.ssh/github
2023-10-24 17:59:00 +00:00
# Run the app
2023-11-23 16:56:52 +00:00
CMD ["nodecid"]