-
Notifications
You must be signed in to change notification settings - Fork 24
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
18 changed files
with
1,002 additions
and
948 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,13 @@ | ||
# Git and VSCode | ||
.git | ||
.gitignore | ||
/.vscode | ||
|
||
# Docker | ||
Dockerfile.* | ||
docker-compose.yml | ||
|
||
# NPM dependencies | ||
node_modules | ||
npm-debug.log | ||
package-lock.json |
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
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
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
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,10 @@ | ||
# Check out https://hub.docker.com/_/node to select a new base image | ||
FROM node:12.19.0-alpine | ||
WORKDIR /app | ||
COPY ./package.json . | ||
COPY tsconfig* ./ | ||
COPY ormconfig* ./ | ||
COPY src ./src | ||
RUN yarn | ||
EXPOSE 3000 | ||
CMD [ "yarn", "dev" ] |
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,18 @@ | ||
# Check out https://hub.docker.com/_/node to select a new base image | ||
FROM node:12.19.0-alpine AS builder | ||
WORKDIR /app | ||
COPY . . | ||
RUN yarn | ||
RUN yarn build | ||
|
||
FROM node:12.19.0-alpine AS production | ||
WORKDIR /app | ||
COPY --from=builder ./app/dist ./dist | ||
COPY package* ./ | ||
COPY tsconfig* ./ | ||
COPY prod-paths* ./ | ||
COPY ormconfig* ./ | ||
RUN yarn install --production | ||
RUN rm -rf dist/__test__ | ||
EXPOSE 3000 | ||
CMD [ "yarn", "prod" ] |
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
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,44 @@ | ||
version: '3' | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
ports: | ||
- '${TYPEORM_PORT}:${TYPEORM_PORT}' | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: "${TYPEORM_DATABASE}" | ||
node-api-base: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile.dev | ||
environment: | ||
PORT: "${PORT}" | ||
JWT_SECRET: "${JWT_SECRET}" | ||
TYPEORM_CONNECTION: postgres | ||
TYPEORM_HOST: postgres | ||
TYPEORM_USERNAME: postgres | ||
TYPEORM_PASSWORD: postgres | ||
TYPEORM_DATABASE: "${TYPEORM_DATABASE}" | ||
TYPEORM_PORT: "${TYPEORM_PORT}" | ||
TYPEORM_SYNCHRONIZE: "true" | ||
TYPEORM_LOGGING: "true" | ||
TYPEORM_MIGRATIONS_RUN: "${TYPEORM_MIGRATIONS_RUN}" | ||
TYPEORM_SEEDING_FACTORIES: "${TYPEORM_SEEDING_FACTORIES}" | ||
TYPEORM_SEEDING_SEEDS: "${TYPEORM_SEEDING_SEEDS}" | ||
ACCESS_TOKEN_LIFE: "${ACCESS_TOKEN_LIFE}" | ||
RATE_LIMIT_WINDOW: "${RATE_LIMIT_WINDOW}" | ||
RATE_LIMIT_MAX_REQUESTS: "${RATE_LIMIT_MAX_REQUESTS}" | ||
S3_ID: "${S3_ID}" | ||
S3_SECRET: "${S3_SECRET}" | ||
S3_BUCKETNAME: "${S3_BUCKETNAME}" | ||
ports: | ||
- '${PORT}:${PORT}' | ||
restart: on-failure | ||
container_name: node-api-base | ||
depends_on: | ||
- postgres | ||
links: | ||
- postgres | ||
volumes: | ||
- "./src:/app/src" | ||
- /src/node_modules |
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
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
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,13 @@ | ||
/* eslint-disable guard-for-in */ | ||
/* eslint-disable no-undef */ | ||
const tsConfig = require('./tsconfig.json'); | ||
const tsConfigPaths = require('tsconfig-paths'); | ||
|
||
const { baseUrl, paths } = tsConfig.compilerOptions; | ||
for (const path in paths) { | ||
paths[path][0] = paths[path][0] | ||
.replace('src', 'dist/src') | ||
.replace('.ts', '.js'); | ||
} | ||
|
||
tsConfigPaths.register({ baseUrl, paths }); |
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
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
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,4 @@ | ||
import { AuthController } from './auth.controller'; | ||
import { UserController } from './users.controller'; | ||
|
||
export const controllers = [AuthController, UserController]; |
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
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,2 @@ | ||
export * from './auth.middleware'; | ||
export * from './logging.middleware'; |
Oops, something went wrong.