jaehyuk-jang

Add k8s setting for fullstack

...@@ -4,15 +4,19 @@ metadata: ...@@ -4,15 +4,19 @@ metadata:
4 name: backend 4 name: backend
5 labels: 5 labels:
6 app: backend 6 app: backend
7 + name: backend
7 spec: 8 spec:
8 selector: 9 selector:
9 matchLabels: 10 matchLabels:
11 + name: backend
10 app: backend 12 app: backend
11 replicas: 1 13 replicas: 1
12 template: 14 template:
13 metadata: 15 metadata:
16 + name: backend
14 labels: 17 labels:
15 app: backend 18 app: backend
19 + name: backend
16 spec: 20 spec:
17 containers: 21 containers:
18 - name: backend 22 - name: backend
......
1 apiVersion: v1 1 apiVersion: v1
2 kind: Service 2 kind: Service
3 metadata: 3 metadata:
4 - labels:
5 - app: backend
6 name: backend 4 name: backend
5 + annotations:
6 + service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
7 spec: 7 spec:
8 - type: ClusterIP 8 + type: LoadBalancer
9 - ports:
10 - - port: 5000
11 - targetPort: 5000
12 selector: 9 selector:
10 + app: backend
13 name: backend 11 name: backend
14 - app: backend
...\ No newline at end of file ...\ No newline at end of file
12 + ports:
13 + - port: 5000
14 + targetPort: 5000
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -8,16 +8,19 @@ metadata: ...@@ -8,16 +8,19 @@ metadata:
8 spec: 8 spec:
9 selector: 9 selector:
10 matchLabels: 10 matchLabels:
11 + name: frontend
11 app: frontend 12 app: frontend
12 replicas: 1 13 replicas: 1
13 template: 14 template:
14 metadata: 15 metadata:
16 + name: frontend
15 labels: 17 labels:
18 + name: frontend
16 app: frontend 19 app: frontend
17 spec: 20 spec:
18 containers: 21 containers:
19 - name: frontend 22 - name: frontend
20 - image: khujay15/next-docker-test:latest 23 + image: khujay15/docker-next-test:0.5
21 ports: 24 ports:
22 - containerPort: 3000 25 - containerPort: 3000
23 name: frontend 26 name: frontend
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -11,9 +11,9 @@ ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" ...@@ -11,9 +11,9 @@ ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
11 RUN apt-get install -y git 11 RUN apt-get install -y git
12 RUN npm install -g yarn 12 RUN npm install -g yarn
13 RUN mkdir /web 13 RUN mkdir /web
14 -RUN git clone --depth=1 http://khuhub.khu.ac.kr/2021-1-capstone-design2/2015104215/ /web 14 +RUN git clone --single-branch --depth=2 http://khuhub.khu.ac.kr/2021-1-capstone-design2/2015104215/ /web
15 RUN cd /web/project;yarn install 15 RUN cd /web/project;yarn install
16 EXPOSE 3000 16 EXPOSE 3000
17 -RUN cd /web/project;yarn build:web 17 +RUN cd /web/project;BACKEND_HOST=http://a2959ec84b48140a59b5eb13b8e36958-58d1454b1c79b5cc.elb.ap-northeast-2.amazonaws.com:5000/graphql yarn build:web
18 WORKDIR /web/project 18 WORKDIR /web/project
19 -CMD [ "yarn", "start:web" ]
...\ No newline at end of file ...\ No newline at end of file
19 +CMD ["yarn", "start:web" ]
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,11 +2,13 @@ apiVersion: v1 ...@@ -2,11 +2,13 @@ apiVersion: v1
2 kind: Service 2 kind: Service
3 metadata: 3 metadata:
4 name: frontend 4 name: frontend
5 + annotations:
6 + service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
5 spec: 7 spec:
6 - type: ClusterIP 8 + type: LoadBalancer
7 - ports:
8 - - port: 3000
9 - targetPort: 3000
10 selector: 9 selector:
11 - name: frontend
12 app: frontend 10 app: frontend
11 + name: frontend
12 + ports:
13 + - port: 3000
14 + targetPort: 3000
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
31 "class-validator": "^0.13.1", 31 "class-validator": "^0.13.1",
32 "graphql": "^15.5.0", 32 "graphql": "^15.5.0",
33 "graphql-tools": "^7.0.4", 33 "graphql-tools": "^7.0.4",
34 + "pg": "^8.6.0",
34 "reflect-metadata": "^0.1.13", 35 "reflect-metadata": "^0.1.13",
35 "rimraf": "^3.0.2", 36 "rimraf": "^3.0.2",
36 "rxjs": "^6.6.6", 37 "rxjs": "^6.6.6",
......
...@@ -20,8 +20,12 @@ import { LikeableModule } from './likeable/likeable.module' ...@@ -20,8 +20,12 @@ import { LikeableModule } from './likeable/likeable.module'
20 sortSchema: true, 20 sortSchema: true,
21 }), 21 }),
22 TypeOrmModule.forRoot({ 22 TypeOrmModule.forRoot({
23 - type: 'sqlite', 23 + type: 'postgres',
24 - database: 'database.db', 24 + host: 'database-1.c1gc442imiw0.ap-northeast-2.rds.amazonaws.com',
25 + port: 5432,
26 + username: 'community',
27 + password: process.env.DB_PASSWORD,
28 + database: 'postgres',
25 entities: ['dist/**/*.entity{.ts,.js}'], 29 entities: ['dist/**/*.entity{.ts,.js}'],
26 synchronize: false, 30 synchronize: false,
27 logging: false, 31 logging: false,
......
...@@ -4688,6 +4688,11 @@ buffer-from@1.x, buffer-from@^1.0.0: ...@@ -4688,6 +4688,11 @@ buffer-from@1.x, buffer-from@^1.0.0:
4688 resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 4688 resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
4689 integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== 4689 integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
4690 4690
4691 +buffer-writer@2.0.0:
4692 + version "2.0.0"
4693 + resolved "https://registry.yarnpkg.com/buffer-writer/-/buffer-writer-2.0.0.tgz#ce7eb81a38f7829db09c873f2fbb792c0c98ec04"
4694 + integrity sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==
4695 +
4691 buffer-xor@^1.0.3: 4696 buffer-xor@^1.0.3:
4692 version "1.0.3" 4697 version "1.0.3"
4693 resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" 4698 resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9"
...@@ -10577,6 +10582,11 @@ package-json@^6.3.0: ...@@ -10577,6 +10582,11 @@ package-json@^6.3.0:
10577 registry-url "^5.0.0" 10582 registry-url "^5.0.0"
10578 semver "^6.2.0" 10583 semver "^6.2.0"
10579 10584
10585 +packet-reader@1.0.0:
10586 + version "1.0.0"
10587 + resolved "https://registry.yarnpkg.com/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74"
10588 + integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==
10589 +
10580 pacote@^11.2.6: 10590 pacote@^11.2.6:
10581 version "11.3.1" 10591 version "11.3.1"
10582 resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.1.tgz#6ce95dd230db475cbd8789fd1f986bec51b4bf7c" 10592 resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.1.tgz#6ce95dd230db475cbd8789fd1f986bec51b4bf7c"
...@@ -10846,6 +10856,57 @@ performance-now@^2.1.0: ...@@ -10846,6 +10856,57 @@ performance-now@^2.1.0:
10846 resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" 10856 resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
10847 integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= 10857 integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
10848 10858
10859 +pg-connection-string@^2.5.0:
10860 + version "2.5.0"
10861 + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.5.0.tgz#538cadd0f7e603fc09a12590f3b8a452c2c0cf34"
10862 + integrity sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==
10863 +
10864 +pg-int8@1.0.1:
10865 + version "1.0.1"
10866 + resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c"
10867 + integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==
10868 +
10869 +pg-pool@^3.3.0:
10870 + version "3.3.0"
10871 + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.3.0.tgz#12d5c7f65ea18a6e99ca9811bd18129071e562fc"
10872 + integrity sha512-0O5huCql8/D6PIRFAlmccjphLYWC+JIzvUhSzXSpGaf+tjTZc4nn+Lr7mLXBbFJfvwbP0ywDv73EiaBsxn7zdg==
10873 +
10874 +pg-protocol@^1.5.0:
10875 + version "1.5.0"
10876 + resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.5.0.tgz#b5dd452257314565e2d54ab3c132adc46565a6a0"
10877 + integrity sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==
10878 +
10879 +pg-types@^2.1.0:
10880 + version "2.2.0"
10881 + resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3"
10882 + integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==
10883 + dependencies:
10884 + pg-int8 "1.0.1"
10885 + postgres-array "~2.0.0"
10886 + postgres-bytea "~1.0.0"
10887 + postgres-date "~1.0.4"
10888 + postgres-interval "^1.1.0"
10889 +
10890 +pg@^8.6.0:
10891 + version "8.6.0"
10892 + resolved "https://registry.yarnpkg.com/pg/-/pg-8.6.0.tgz#e222296b0b079b280cce106ea991703335487db2"
10893 + integrity sha512-qNS9u61lqljTDFvmk/N66EeGq3n6Ujzj0FFyNMGQr6XuEv4tgNTXvJQTfJdcvGit5p5/DWPu+wj920hAJFI+QQ==
10894 + dependencies:
10895 + buffer-writer "2.0.0"
10896 + packet-reader "1.0.0"
10897 + pg-connection-string "^2.5.0"
10898 + pg-pool "^3.3.0"
10899 + pg-protocol "^1.5.0"
10900 + pg-types "^2.1.0"
10901 + pgpass "1.x"
10902 +
10903 +pgpass@1.x:
10904 + version "1.0.4"
10905 + resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-1.0.4.tgz#85eb93a83800b20f8057a2b029bf05abaf94ea9c"
10906 + integrity sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==
10907 + dependencies:
10908 + split2 "^3.1.1"
10909 +
10849 picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: 10910 picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
10850 version "2.2.3" 10911 version "2.2.3"
10851 resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" 10912 resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d"
...@@ -10938,6 +10999,28 @@ postcss@^7.0.32: ...@@ -10938,6 +10999,28 @@ postcss@^7.0.32:
10938 source-map "^0.6.1" 10999 source-map "^0.6.1"
10939 supports-color "^6.1.0" 11000 supports-color "^6.1.0"
10940 11001
11002 +postgres-array@~2.0.0:
11003 + version "2.0.0"
11004 + resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e"
11005 + integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==
11006 +
11007 +postgres-bytea@~1.0.0:
11008 + version "1.0.0"
11009 + resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35"
11010 + integrity sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=
11011 +
11012 +postgres-date@~1.0.4:
11013 + version "1.0.7"
11014 + resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8"
11015 + integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==
11016 +
11017 +postgres-interval@^1.1.0:
11018 + version "1.2.0"
11019 + resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695"
11020 + integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==
11021 + dependencies:
11022 + xtend "^4.0.0"
11023 +
10941 prelude-ls@^1.2.1: 11024 prelude-ls@^1.2.1:
10942 version "1.2.1" 11025 version "1.2.1"
10943 resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" 11026 resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
...@@ -12539,7 +12622,7 @@ split-string@^3.0.1, split-string@^3.0.2: ...@@ -12539,7 +12622,7 @@ split-string@^3.0.1, split-string@^3.0.2:
12539 dependencies: 12622 dependencies:
12540 extend-shallow "^3.0.0" 12623 extend-shallow "^3.0.0"
12541 12624
12542 -split2@^3.0.0: 12625 +split2@^3.0.0, split2@^3.1.1:
12543 version "3.2.2" 12626 version "3.2.2"
12544 resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" 12627 resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f"
12545 integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== 12628 integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==
......