diff --git a/Dockerfile b/Dockerfile index ff348b8..56f81ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN npm run build FROM node:20 WORKDIR /app COPY package*.json ./ -RUN npm pkg set scripts.prepare='true' && npm ci --only=production +RUN npm pkg set scripts.prepare='true' && npm ci --omit=dev COPY --from=build /src/dist /app/dist EXPOSE 3333 CMD [ "npm", "run", "prod" ] diff --git a/docker-compose.yml b/docker-compose.yml index b432de9..84d6078 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,20 @@ version: '3' services: - mysql: - image: 'mysql:8.2.0' + #mysql: + # image: 'mysql:8.2.0' + # ports: + # - '3306:3306' + # environment: + # MYSQL_ROOT_PASSWORD: 'admin' + # MYSQL_USER: 'test' + # MYSQL_PASSWORD: 'test' + # MYSQL_DATABASE: 'test' + api: + build: . + container_name: api ports: - - '3306:3306' - environment: - MYSQL_ROOT_PASSWORD: 'admin' - MYSQL_USER: 'test' - MYSQL_PASSWORD: 'test' - MYSQL_DATABASE: 'test' + - "3333:3333" + volumes: + - ./serverless_express_template.db:/app/serverless_express_template.db + #depends_on: + # - mysql diff --git a/package.json b/package.json index 812ce36..17b72d6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "serverless-express-template", "version": "0.0.1", - "templateVersion": "1.6.0", + "templateVersion": "1.7.1", "description": "A template for serverless-express", "main": "./lambda.js", "type": "commonjs", @@ -64,6 +64,7 @@ "compression": "1.7.4", "config": "3.3.11", "cors": "2.8.5", + "cross-env": "7.0.3", "dayjs": "1.11.11", "dotenv": "16.3.1", "ejs": "3.1.10", @@ -109,7 +110,6 @@ "babel-plugin-transform-typescript-metadata": "0.3.2", "commitizen": "4.3.0", "commitizen-emoji": "1.0.5", - "cross-env": "7.0.3", "cross-var": "1.1.0", "eslint": "8.57.0", "eslint-config-airbnb-base": "15.0.0", diff --git a/serverless_express_template.db b/serverless_express_template.db index 562dbf8..9e39bc5 100644 Binary files a/serverless_express_template.db and b/serverless_express_template.db differ diff --git a/src/database/sources/production.source.ts b/src/database/sources/production.source.ts index 0e8f9ed..07849ce 100644 --- a/src/database/sources/production.source.ts +++ b/src/database/sources/production.source.ts @@ -16,7 +16,9 @@ const productionDataSource = new DataSource({ }, logging: false, entities: [`${path.resolve(__dirname, '..', '..')}/entities/*.{js,ts}`], - migrations: [`${path.resolve(__dirname, '..')}/migrations/migrations-*.{js,ts}`], + migrations: [ + `${path.resolve(__dirname, '..')}/migrations/*-migrations.{js,ts}`, + ], subscribers: [], });