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
47 changes: 47 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.dockerignore
README.md
LICENSE
**/docker-compose*
**/Dockerfile*

#Git
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
**/.git
**/.gitignore

# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
**/.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

#Lint
.eslintrc.js
.prettierrc

npm-debug.log
.env*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ lerna-debug.log*
.classpath
.c9/
*.launch

.settings/
*.sublime-workspace

Expand All @@ -36,3 +37,5 @@ lerna-debug.log*
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
/appsettings.json
/src/.env
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:20-alpine AS dev
WORKDIR /app
COPY --chown=node:node package*.json ./
RUN npm ci
COPY --chown=node:node . .
USER node

FROM node:20-alpine AS build
WORKDIR /app
COPY --chown=node:node package*.json ./
COPY --chown=node:node --from=dev /app/node_modules ./node_modules
COPY --chown=node:node . .
RUN npm run build

ENV NODE_ENV=prod
RUN npm ci --only=prod && npm cache clean --force

USER node

FROM node:20-alpine AS prod
WORKDIR /app
COPY --chown=node:node --from=build /app/node_modules ./node_modules
COPY --chown=node:node --from=build /app/dist ./dist

EXPOSE 4000

CMD [ "node", "dist/main.lambda.js" ]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,25 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
## License

Nest is [MIT licensed](LICENSE).

## Python
```bash
$ pip install virtualenv
$ pip --version
$ python -m pip install --upgrade pip
```

## Docker
```bash
$ docker build -t cart-service .
$ docker run -d -p 4000:4000 --name cart-service-container cart-service:latest
$ docker exec -it cart-service-container sh
$ docker images
```

## Eb
```bash
$ eb init
$ eb create --cname tati-moon-cart-api-dev --single
$ eb deploy
```
Loading