mirror of
https://github.com/Cameri/nostream.git
synced 2025-03-17 13:21:45 +01:00
83 lines
1.6 KiB
Docker
83 lines
1.6 KiB
Docker
## Author Saransh Sharma @cynsar foundation
|
|
FROM node:18-alpine3.16 as build
|
|
|
|
ARG PORT
|
|
ARG PGHOST
|
|
ARG PGPORT
|
|
ARG PGDATABASE
|
|
ARG PGUSER
|
|
ARG PGPASSWORD
|
|
|
|
WORKDIR /build
|
|
|
|
## Build Setup for Railways
|
|
ENV DB_HOST=$PGHOST
|
|
ENV DB_PORT=$PGPORT
|
|
ENV DB_NAME=$PGDATABASE
|
|
ENV DB_USER=$PGUSER
|
|
ENV DB_PASSWORD=$PGPASSWORD
|
|
|
|
COPY ["package.json", "package-lock.json","knexfile.js","./"]
|
|
|
|
ADD migrations /build/migrations
|
|
|
|
RUN npm install -g knex@2.4.0 && npm install --quiet
|
|
|
|
RUN npm run db:migrate
|
|
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
FROM node:18-alpine3.16
|
|
|
|
ARG PORT
|
|
ARG PGHOST
|
|
ARG PGPORT
|
|
ARG PGDATABASE
|
|
ARG PGUSER
|
|
ARG PGPASSWORD
|
|
ARG REDISHOST
|
|
ARG REDISUSER
|
|
ARG REDISPORT
|
|
ARG REDISPASSWORD
|
|
ARG DEBUG
|
|
ARG DB_MIN_POOL_SIZE=16
|
|
ARG DB_MAX_POOL_SIZE=64
|
|
ARG WORKER_COUNT=8
|
|
|
|
ENV WORKER_COUNT=$WORKER_COUNT
|
|
ENV RELAY_PORT=$PORT
|
|
ENV DB_HOST=$PGHOST
|
|
ENV DB_PORT=$PGPORT
|
|
ENV DB_NAME=$PGDATABASE
|
|
ENV DB_USER=$PGUSER
|
|
ENV DB_PASSWORD=$PGPASSWORD
|
|
ENV DB_MIN_POOL_SIZE=$DB_MIN_POOL_SIZE
|
|
ENV DB_MAX_POOL_SIZE=$DB_MAX_POOL_SIZE
|
|
ENV NOSTR_CONFIG_DIR=/home/node/.nostr
|
|
|
|
ENV REDIS_HOST=$REDISHOST
|
|
ENV REDIS_PORT=$REDISPORT
|
|
ENV REDIS_USER=$REDISUSER
|
|
ENV REDIS_PASSWORD=$REDISPASSWORD
|
|
|
|
LABEL org.opencontainers.image.title="Nostream"
|
|
LABEL org.opencontainers.image.source=https://github.com/cameri/nostream
|
|
LABEL org.opencontainers.image.description="nostream"
|
|
LABEL org.opencontainers.image.authors="Ricardo Arturo Cabral Mejía"
|
|
LABEL org.opencontainers.image.licenses=MIT
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /build/dist .
|
|
|
|
RUN npm install --omit=dev --quiet
|
|
|
|
USER 1000:1000
|
|
|
|
RUN mkdir -p $NOSTR_CONFIG_DIR
|
|
|
|
CMD ["node", "src/index.js"]
|