-
Notifications
You must be signed in to change notification settings - Fork 0
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
20 changed files
with
439 additions
and
23,567 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,7 @@ | ||
PORT="3000" | ||
NODE_ENV="development" | ||
SONG_BASE_URL="http://mage.tech:8899" | ||
SONG_BASE_URL_DOCKER="http://nginx" | ||
SONG_BASE_URL_PROD="https://141.95.67.178:32100" | ||
S3_BUCKET="curator" | ||
S3_URL="http://192.168.178.174:9000" # minio |
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,20 @@ | ||
FROM node:16-alpine3.15 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN apk add g++ make py3-pip python3 | ||
RUN npm install glob rimraf --force | ||
RUN apk add ffmpeg | ||
RUN pip install pydub | ||
|
||
RUN npm install mkdirp@latest | ||
RUN npm install -g @nestjs/cli | ||
|
||
|
||
COPY . . | ||
|
||
|
||
RUN npm install | ||
RUN npm run build |
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 |
---|---|---|
@@ -1,38 +1,16 @@ | ||
version: '3' | ||
version: '3.7' | ||
|
||
services: | ||
api: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
- NODE_ENV=development | ||
environment: | ||
- PORT=3000 | ||
- DB_HOST=postgres | ||
- DB_PORT=5432 | ||
- DB_USER=postgres | ||
- DB_PW=crudjs | ||
dev: | ||
container_name: nestjs_api_prod | ||
image: atemndobs/nestjs_api_prod:v2 | ||
command: ["sh", "-c", "npm run start"] | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- postgres | ||
links: | ||
- postgres:postgres | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
command: npm run dev | ||
|
||
postgres: | ||
image: postgres:alpine | ||
restart: always | ||
environment: | ||
- DB_USER=postgres | ||
- DB_PASS=crudjs | ||
|
||
adminer: | ||
image: adminer | ||
- 9229:9229 | ||
restart: always | ||
ports: | ||
- 8080:8080 | ||
# volumes: | ||
# - .:/usr/src/app | ||
networks: | ||
default: | ||
name: laravel_sail |
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,17 @@ | ||
FROM node:alpine | ||
|
||
USER node | ||
|
||
RUN mkdir /home/node/app | ||
WORKDIR /home/node/app | ||
COPY . /home/node/app | ||
RUN npm install --production | ||
|
||
# CMD [ "npm", "start" ] | ||
CMD ["node", "dist/server.js"] | ||
EXPOSE 3000 | ||
|
||
# Install development packages if NODE_ENV is set to "development" | ||
ARG NODE_ENV | ||
ENV NODE_ENV $NODE_ENV | ||
RUN if [ "$NODE_ENV" == "development" ]; then npm install ; fi |
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,39 @@ | ||
FROM node:16-alpine3.15 AS development | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN apk add g++ make py3-pip python3 | ||
RUN npm install glob rimraf --force | ||
RUN apk add ffmpeg | ||
RUN pip install pydub | ||
|
||
RUN npm install mkdirp@latest | ||
|
||
RUN npm install --only=development | ||
|
||
RUN npm install -g @nestjs/cli | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
FROM node:16-alpine3.15 as production | ||
|
||
ARG NODE_ENV=production | ||
ENV NODE_ENV=${NODE_ENV} | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install --only=production | ||
|
||
COPY . . | ||
|
||
COPY --from=development /usr/src/app/dist ./dist | ||
|
||
# | ||
|
||
CMD ["node", "dist/main"] |
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,42 @@ | ||
version: '3.7' | ||
|
||
services: | ||
api: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
- NODE_ENV=development | ||
environment: | ||
- PORT=3000 | ||
|
||
|
||
|
||
ports: | ||
- 3000:3000 | ||
# depends_on: | ||
# - postgres | ||
# links: | ||
# - postgres:postgres | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
command: npm run dev | ||
|
||
# postgres: | ||
# image: postgres:alpine | ||
# restart: always | ||
# environment: | ||
# - DB_USER=postgres | ||
# - DB_PASS=crudjs | ||
# | ||
# adminer: | ||
# image: adminer | ||
# restart: always | ||
# ports: | ||
# - 5450:8080 | ||
|
||
networks: | ||
default: | ||
external: | ||
name: laravel_sail |
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,41 @@ | ||
version: '3.7' | ||
|
||
services: | ||
dev: | ||
container_name: nestjs_api_dev | ||
image: atemndobs/nestjs_api_dev:v1 | ||
# build: | ||
# context: . | ||
# target: development | ||
# dockerfile: ./Dockerfile | ||
command: npm run start:debug | ||
ports: | ||
- 3000:3000 | ||
- 9229:9229 | ||
volumes: | ||
- 'nestjs-data:/usr/src/' | ||
restart: always | ||
|
||
# prod: | ||
# container_name: nestjs_api_prod | ||
# image: nestjs_api_prod | ||
# build: | ||
# context: . | ||
# target: production | ||
# dockerfile: ./Dockerfile | ||
# command: npm run start:prod | ||
# ports: | ||
# - 3000:3000 | ||
# - 9229:9229 | ||
# volumes: | ||
# - .:/usr/src/app | ||
# - /usr/src/app/node_modules | ||
# - 'nestjs-data:/usr/src/' | ||
# restart: always | ||
networks: | ||
default: | ||
name: laravel_sail | ||
|
||
volumes: | ||
nestjs-data: | ||
driver: local |
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,46 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nest-app | ||
namespace: curator | ||
spec: | ||
selector: | ||
app: nest-app | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 3000 | ||
targetPort: 3000 | ||
nodePort: 31200 | ||
- name: debug | ||
protocol: TCP | ||
port: 9229 | ||
targetPort: 9229 | ||
type: LoadBalancer | ||
# Set the fixed port for the LoadBalancer service | ||
# loadBalancerIP: <your-external-IP> | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nest-app | ||
namespace: curator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nest-app | ||
template: | ||
metadata: | ||
labels: | ||
app: nest-app | ||
spec: | ||
containers: | ||
- name: nest-app | ||
image: atemndobs/nestjs_api_prod:v2 | ||
command: ["sh", "-c", "npm run start"] | ||
ports: | ||
- containerPort: 3000 | ||
- containerPort: 9229 | ||
imagePullPolicy: Always |
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,39 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert -f ../docker-compose.yml | ||
kompose.version: 1.28.0 (c4137012e) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: dev | ||
name: dev | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
io.kompose.service: dev | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert -f ../docker-compose.yml | ||
kompose.version: 1.28.0 (c4137012e) | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.network/laravel-sail: "true" | ||
io.kompose.service: dev | ||
spec: | ||
containers: | ||
- args: | ||
- sh | ||
- -c | ||
- npm run start | ||
image: atemndobs/nestjs_api_prod:v2 | ||
name: nestjs-api-prod | ||
ports: | ||
- containerPort: 3000 | ||
- containerPort: 9229 | ||
resources: {} | ||
restartPolicy: Always | ||
status: {} |
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,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
kompose.cmd: kompose convert -f ../docker-compose.yml | ||
kompose.version: 1.28.0 (c4137012e) | ||
labels: | ||
io.kompose.service: dev | ||
name: dev | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: http | ||
port: 3000 | ||
targetPort: 3000 | ||
nodePort: 30202 | ||
- name: debug | ||
port: 9229 | ||
targetPort: 9229 | ||
nodePort: 31840 | ||
selector: | ||
io.kompose.service: 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,14 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
creationTimestamp: null | ||
name: laravel-sail | ||
spec: | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
io.kompose.network/laravel-sail: "true" | ||
podSelector: | ||
matchLabels: | ||
io.kompose.network/laravel-sail: "true" |
Oops, something went wrong.