Skip to content

Commit b87d91c

Browse files
Saransh Sharmacameri
authored andcommitted
Dockerfile Additiong
1 parent 855140d commit b87d91c

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

Dockerfile.railwayapp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## Author Saransh Sharma @cynsar foundation
2+
FROM node:18-alpine3.16 as build
3+
4+
ARG DB_HOST
5+
ARG DB_PORT
6+
ARG DB_NAME
7+
ARG DB_USER
8+
ARG DB_PASSWORD
9+
10+
WORKDIR /build
11+
12+
13+
COPY ["package.json", "package-lock.json","knexfile.js","./"]
14+
15+
ADD migrations /build/migrations
16+
17+
RUN mkdir ~/.nostr
18+
19+
RUN npm install -g [email protected]
20+
21+
RUN npm install knex --quiet
22+
23+
RUN npm install --quiet
24+
25+
RUN npm run db:migrate
26+
27+
28+
29+
COPY . .
30+
31+
RUN npm run build
32+
33+
FROM node:18-alpine3.16
34+
35+
LABEL org.opencontainers.image.title="Nostr Typescript Relay"
36+
LABEL org.opencontainers.image.source=https://github.com/Cameri/nostr-ts-relay
37+
LABEL org.opencontainers.image.description="nostr-ts-relay"
38+
LABEL org.opencontainers.image.authors="Ricardo Arturo Cabral Mejía"
39+
LABEL org.opencontainers.image.licenses=MIT
40+
41+
## Build Setup for Railways
42+
ENV DB_HOST=$DB_HOST
43+
ENV DB_PORT=$DB_PORT
44+
ENV DB_NAME=$DB_NAME
45+
ENV DB_USER=$DB_USER
46+
ENV DB_PASSWORD=$DB_PASSWORD
47+
48+
49+
WORKDIR /app
50+
51+
COPY --from=build /build/dist .
52+
53+
RUN npm install --omit=dev --quiet
54+
55+
USER 1000:1000
56+
57+
CMD ["node", "src/index.js"]

0 commit comments

Comments
 (0)