Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ node_modules/
.env*
!.env.example
.prettierrc
tests/
7-sprint-mission/
coverage/

# Uploaded files
public/*
Expand Down
14 changes: 14 additions & 0 deletions infra/ec2/ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
apps: [
{
name: 'pandamarket',
script: './dist/main.js',
instances: 1,
autorestart: true,
watch: false,
env: {
NODE_ENV: 'production',
},
},
],
};
13 changes: 13 additions & 0 deletions infra/ec2/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
server {
listen 80;
server_name http://54.180.29.185;

location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Binary file added infra/ec2/secure-group-inbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added infra/ec2/secure-group-outbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions infra/ec2/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 1. PM2 설치
npm install pm2 -g

# 2. PM2 설정 파일 생성
pm2 init

# 3. 설정 파일 편집
nano ecosystem.config.js

# 4. 설정 파일을 읽어서 서버 실행
pm2 start ecosystem.config.js

# 5. 서버 재부팅 시 PM2가 자동 실행되도록 OS 등록 스크립트 생성
pm2 startup

# 6. 나오는 sudo 명령어 복사해서 실행

# 7. 현재 실행 중인 프로세스 상태를 저장
pm2 save
Binary file added infra/rds/secure-group-inbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added infra/rds/secure-group-outbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added infra/s3/policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
setupFiles: ['dotenv/config'],
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
coverageDirectory: 'coverage',
collectCoverageFrom: [
'src/**/*.{ts,js}',
'!src/**/*.d.ts',
'!src/main.ts',
],
forceExit: true,
};
Loading