A social knowledge tool for researchers built on ATProto
at main 933 B view raw
1# syntax = docker/dockerfile:1 2 3# Adjust NODE_VERSION as desired 4ARG NODE_VERSION=18.18.2 5FROM node:${NODE_VERSION}-slim AS base 6 7LABEL fly_launch_runtime="Node.js" 8 9# Node.js app lives here 10WORKDIR /app 11 12# Set production environment 13ENV NODE_ENV="dev" 14 15 16# Throw-away build stage to reduce size of final image 17FROM base AS build 18 19# Install packages needed to build node modules 20RUN apt-get update -qq && \ 21 apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 22 23# Install node modules 24COPY package-lock.json package.json ./ 25RUN npm ci --include=dev 26 27# Copy application code 28COPY . . 29 30# Build application 31RUN npm run build 32 33# Remove development dependencies 34RUN npm prune --omit=dev 35 36 37# Final stage for app image 38FROM base 39 40# Copy built application 41COPY --from=build /app /app 42 43# Start the server by default, this can be overwritten at runtime 44EXPOSE 3000 45CMD [ "node", "dist/index.js" ]