diff --git a/Dockerfile b/Dockerfile index 3d95a47..614aed9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,14 +9,7 @@ RUN npm install --production=false COPY tsconfig.json ./ COPY src ./src -ENV PORT=20205 -ENV DB_NAME=Identity_verification -ENV DB_USER=root -ENV DB_PASS=changeme -ENV DB_HOST=mysql -ENV DB_PORT=3306 -ENV JIBIT_API_KEY=change_me -ENV JIBIT_SECRET_KEY=change_me + EXPOSE 20205 diff --git a/docker-compose.yml b/docker-compose.yml index 3043ec0..f3c0f6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,23 +1,11 @@ version: '3.9' services: - mysql: - image: mysql:8.0 - container_name: iv_mysql - restart: unless-stopped - environment: - MYSQL_DATABASE: ${DB_NAME:-Identity_verification} - MYSQL_ROOT_PASSWORD: ${DB_PASS:-changeme} - ports: - - "3307:3306" - volumes: - - mysql_data:/var/lib/mysql app: build: . container_name: iv_app restart: unless-stopped - env_file: - - .env + environment: PORT: ${PORT:-20205} DB_NAME: ${DB_NAME:-Identity_verification} @@ -29,8 +17,7 @@ services: JIBIT_SECRET_KEY: ${JIBIT_SECRET_KEY:-change_me} ports: - "${PORT:-20205}:${PORT:-20205}" - depends_on: - - mysql + volumes: mysql_data: \ No newline at end of file diff --git a/git.sh b/git.sh new file mode 100644 index 0000000..955edc1 --- /dev/null +++ b/git.sh @@ -0,0 +1,4 @@ +sudo apt install jcal -y +sudo git add . +sudo git commit -m "$(jdate '+%Y/%m/%d %H:%M:%S') - auto commit" || true +sudo git push diff --git a/src/config/database.ts b/src/config/database.ts index 63da653..60658ac 100644 --- a/src/config/database.ts +++ b/src/config/database.ts @@ -1,10 +1,10 @@ import { Sequelize } from 'sequelize'; -const DB_NAME = process.env.DB_NAME || 'Identity_verification'; -const DB_USER = process.env.DB_USER || 'root'; -const DB_PASS = process.env.DB_PASS || '@8@w!1o*8Aq@8P$L20'; -const DB_HOST = process.env.DB_HOST || '185.97.116.24'; -const DB_PORT = parseInt(process.env.DB_PORT || '3306', 10); +const DB_NAME = 'Identity_verification'; +const DB_USER = 'root'; +const DB_PASS ='@8@w!1o*8Aq@8P$L20'; +const DB_HOST = '185.97.116.24'; +const DB_PORT = '3306'; // اتصال به دیتابیس MySQL export const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PASS, {