forked from cameri/nostream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.railwayapp
82 lines (61 loc) · 1.56 KB
/
Dockerfile.railwayapp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
## 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 [email protected] && 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"]