Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ngrok deploy #101

Closed
wants to merge 14 commits into from
Closed
15 changes: 0 additions & 15 deletions .devcontainer/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions .devcontainer/devcontainer.json

This file was deleted.

44 changes: 0 additions & 44 deletions .devcontainer/docker-compose.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .devcontainer/postCreateCommand.sh

This file was deleted.

6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_DB="db"
POSTGRES_USER="user"
POSTGRES_PASSWORD="pass"
POSTGRES_HOST="host"
NGROK_AUTH="authngrok"
NGROK_HOSTNAME="hostname"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@ postgres/

# Local Uploads
/backend/uploads/*
data
27 changes: 10 additions & 17 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
DOMAIN="" # domain to use for cookies (default: localhost)
APP_NAME="Confia Driven Development"
FRONTEND_URL="http://localhost:9000"
############################### Prisma Setup ################################
POSTGRES_USER="user"
POSTGRES_PASSWORD="password"
POSTGRES_DB="postgres"
POSTGRES_HOST="postgres"

DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?schema=public"
DOMAIN="example.vercel.app" # domain to use for cookies (default: localhost)
APP_NAME="Example app name"
FRONTEND_URL="https://example.vercel.app"

############################### Intra Auth Setup ###############################
INTRA_CLIENT_ID=""
INTRA_CLIENT_SECRET=""
INTRA_CALLBACK_URL="http://localhost:3000/auth/intra/callback"
INTRA_CLIENT_ID="u-s4t2ud-example"
INTRA_CLIENT_SECRET="s-s4t2ud-example"
INTRA_CALLBACK_URL="http://example.ngrok-free.app/auth/intra/callback"

################################## JWT Secret ##################################
JWT_SECRET=""
ACCESS_TOKEN_EXPIRATION="" # 15m # Increase to stay logged in for longer without refreshing
REFRESH_TOKEN_EXPIRATION="" # 7d # after this time, the user will have to log in again
JWT_SECRET="the-example-secret"
ACCESS_TOKEN_EXPIRATION="60m" # 15m # Increase to stay logged in for longer without refreshing
REFRESH_TOKEN_EXPIRATION="7d" # 7d # after this time, the user will have to log in again

################################## HASH Secret ##################################
HASH_PEPPER="" # At least 16 bytes long for security (128 bits) (32 bytes recommended)
HASH_PEPPER="the-example-hash" # At least 16 bytes long for security (128 bits) (32 bytes recommended)
25 changes: 7 additions & 18 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
###################
# BUILD FOR LOCAL DEVELOPMENT
###################
FROM node:18

# Base image
FROM node:18 AS development
WORKDIR /usr/src/app/server

# Set working directory
WORKDIR /usr/src/app
COPY . .

# Copy package.json and package-lock.json
COPY --chown=node:node package*.json ./
RUN npm i
RUN npm run build

# Install dependencies
RUN npm ci
RUN npm install -g @nestjs/cli
EXPOSE 3000

# Copy source code
COPY --chown=node:node . .
CMD [ "npm", "run", "start:docker" ]

# Generate Prisma database client code
RUN npm run prisma:generate

ENTRYPOINT [ "npm", "run", "start:dev" ]
Loading