unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at angular21 48 lines 1.1 kB view raw
1# Build stage 2FROM node:24-alpine AS build 3 4# include important binaries 5RUN apk add --no-cache perl curl tini bash ffmpeg exiv2 6 7# set working directory 8WORKDIR /app/packages/backend 9 10# copy package.json and package-lock.json 11COPY package.json /app 12COPY package-lock.json /app 13COPY packages/backend/package.json . 14 15# set node_env as production for the npm install command 16ENV NODE_ENV=production 17 18# install dependencies 19RUN npm install 20 21# copy the rest of the files 22COPY packages/backend . 23 24# create log folder early to prevent node err: cannot open logs/*.log 25RUN mkdir -p logs 26 27COPY packages/backend/environment.dev.ts environment.ts 28 29RUN npm run type-check 30 31# some default values 32ENV POSTGRES_HOST=db 33ENV POSTGRES_PORT=5432 34ENV REDIS_HOST=redis 35ENV REDIS_PORT=6379 36ENV LISTEN_IP=0.0.0.0 37ENV PORT=9000 38ENV LOG_DESTINATION=1 39 40# expose port from environment.ts 41EXPOSE ${PORT} 42 43# set up configuration from environment, then run tini as entrypoint to be able to handle kernel signals 44ENTRYPOINT ["tini","--","./docker-entrypoint.sh"] 45 46ENV NODE_OPTIONS=--dns-result-order=ipv4first 47 48CMD ["npm","start"]