simple-links/Dockerfile

30 lines
621 B
Docker
Raw Normal View History

2023-07-12 10:21:38 +00:00
FROM node:lts-slim
2023-07-08 19:49:08 +00:00
2023-07-01 20:43:53 +00:00
ENV NODE_ENV=production
WORKDIR /usr/src/app
2023-07-12 10:21:38 +00:00
2023-07-12 13:24:42 +00:00
RUN apt update
2023-07-12 13:26:54 +00:00
RUN DEBIAN_FRONTEND=noninteractive apt install wget -y
2023-07-12 13:23:50 +00:00
2023-07-12 10:21:38 +00:00
# Copy package.json and package-lock.json separately to fully utilize Docker layer caching
COPY package.json ./
COPY package-lock.json ./
RUN npm ci --production --silent && npm cache clean --force
# Opt out of Next.js telemetry
2023-07-02 11:05:27 +00:00
RUN npx next telemetry disable
2023-07-12 10:30:38 +00:00
# Copy the rest of the files
COPY . .
# Remove development dependencies
RUN npm prune --production
2023-07-12 12:55:48 +00:00
# Environment Variables
ENV NODE_ENV=production
2023-07-12 10:21:38 +00:00
# Expose port 3000
EXPOSE 3000
# Start the app
CMD ["bash", "start.sh"]