Skip to content

Commit

Permalink
feat: ready to deploy openauth service using password as provider (#1)
Browse files Browse the repository at this point in the history
* feat: ready to deploy openauth service using password as provider

* chore: fix prettier

* chore: fix test run

* fix: user id was not set if user was found

* feat: email verification
  • Loading branch information
birme authored Feb 23, 2025
1 parent 1707264 commit afebae6
Show file tree
Hide file tree
Showing 12 changed files with 607 additions and 71 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
ARG NODE_IMAGE=node:18-alpine
ARG NODE_IMAGE=node:18-alpine3.21

FROM ${NODE_IMAGE}
ENV NODE_ENV=production
EXPOSE 8000
RUN mkdir /app
RUN chown node:node /app
USER node
WORKDIR /app
COPY --chown=node:node ["package.json", "package-lock.json*", "tsconfig*.json", "./"]
COPY --chown=node:node ["src", "./src"]
COPY ./docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Delete prepare script to avoid errors from husky
RUN npm pkg delete scripts.prepare \
&& npm ci --omit=dev
VOLUME [ "/data" ]
ENV DATA_DIR=/data

ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
CMD [ "npm", "run", "start" ]
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

chown -R node:node $DATA_DIR

su -p node -c "cd /app && $*"
4 changes: 2 additions & 2 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
testEnvironment: 'node'
};
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"watch": ["src"],
"ext": "ts",
"exec": "node --inspect -r ts-node/register ./src/server.ts"
}
}
Loading

0 comments on commit afebae6

Please sign in to comment.