-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
## Author Saransh Sharma @cynsar foundation | ||
FROM node:18-alpine3.16 as build | ||
|
||
ARG DB_HOST | ||
ARG DB_PORT | ||
ARG DB_NAME | ||
ARG DB_USER | ||
ARG DB_PASSWORD | ||
|
||
WORKDIR /build | ||
|
||
|
||
COPY ["package.json", "package-lock.json","knexfile.js","./"] | ||
|
||
ADD migrations /build/migrations | ||
|
||
RUN mkdir ~/.nostr | ||
|
||
RUN npm install -g [email protected] | ||
|
||
RUN npm install knex --quiet | ||
|
||
RUN npm install --quiet | ||
|
||
RUN npm run db:migrate | ||
|
||
|
||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
FROM node:18-alpine3.16 | ||
|
||
LABEL org.opencontainers.image.title="Nostr Typescript Relay" | ||
LABEL org.opencontainers.image.source=https://github.com/Cameri/nostr-ts-relay | ||
LABEL org.opencontainers.image.description="nostr-ts-relay" | ||
LABEL org.opencontainers.image.authors="Ricardo Arturo Cabral Mejía" | ||
LABEL org.opencontainers.image.licenses=MIT | ||
|
||
## Build Setup for Railways | ||
ENV DB_HOST=$DB_HOST | ||
ENV DB_PORT=$DB_PORT | ||
ENV DB_NAME=$DB_NAME | ||
ENV DB_USER=$DB_USER | ||
ENV DB_PASSWORD=$DB_PASSWORD | ||
|
||
|
||
WORKDIR /app | ||
|
||
COPY --from=build /build/dist . | ||
|
||
RUN npm install --omit=dev --quiet | ||
|
||
USER 1000:1000 | ||
|
||
CMD ["node", "src/index.js"] |