personal-site/Dockerfile

32 lines
541 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
COPY package*.json ./
2023-10-29 12:06:22 +00:00
RUN apk update
2023-10-29 15:49:24 +00:00
RUN apk add git openssh bash nano
RUN touch /root/.bashrc
RUN echo 'alias ll="ls -laF"' > /root/.bashrc
2023-10-29 11:40:23 +00:00
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
# Copy source code
COPY . .
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"]