Skip to content

Commit

Permalink
feat: login register done
Browse files Browse the repository at this point in the history
  • Loading branch information
bernarduswillson committed Oct 26, 2023
1 parent 69ad60b commit 11fc425
Show file tree
Hide file tree
Showing 12 changed files with 4,062 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
# Keep environment variables out of version control
.env
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use the official Node.js image as the base image
FROM node:latest

# Set the working directory in the container
WORKDIR /app

COPY package*.json ./
COPY tsconfig.json ./tsconfig.json
COPY ./prisma/schema.prisma ./prisma/

RUN npm install
RUN npm uninstall bcrypt
RUN npm install bcrypt@latest --save
RUN npx prisma generate

COPY . .

RUN npm run build

EXPOSE 5000

CMD [ "npm", "start"]
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.3'
services:
postgres:
image: postgres:latest
restart: always
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: bewe
POSTGRES_DB: tocorest
volumes:
- "./prisma/migrations/db:/docker-entrypoint-initdb.d"

express:
image: node:latest
build: .
ports:
- 5000:5000
restart: always
depends_on:
- postgres
environment:
DATABASE_URL: postgresql://postgres:bewe@postgres:5432/tocorest
JWT_SECRET: secret
7 changes: 7 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"watch": ["src/"],
"ext": ".ts",
"ignore": ["node_modules"],
"exec": "npm ts-node ./src/index.ts"
}

Loading

0 comments on commit 11fc425

Please sign in to comment.