Skip to content

Commit

Permalink
Dockerfile Additiong
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh Sharma authored and cameri committed Nov 11, 2022
1 parent 855140d commit b87d91c
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Dockerfile.railwayapp
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"]

0 comments on commit b87d91c

Please sign in to comment.