Skip to content

Commit

Permalink
feat: new mongo image
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpho93 committed Sep 20, 2022
1 parent 6ad0304 commit f7fbd83
Show file tree
Hide file tree
Showing 46 changed files with 25 additions and 58,261 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
docker:
- image: circleci/node:14.18.1-stretch
# Integration tests need MongoDB server running and accessible on port 27017
- image: circleci/mongo:4.0.0
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
Expand All @@ -127,7 +127,7 @@ jobs:
docker:
- image: circleci/node:14.18.1-stretch
# Integration tests need MongoDB server running and accessible on port 27017
- image: circleci/mongo:4.0.0
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
name: Build and push production Docker image
command: |
VERSION=$(git describe --tags `git rev-list --tags --max-count=1` | cut -c2-100)
docker build -t ${DOCKER_REPOSITORY}:${VERSION} -t ${DOCKER_REPOSITORY}:latest .
docker build -t ${DOCKER_REPOSITORY}:${VERSION} -t ${DOCKER_REPOSITORY}:latest -f ./app/reaction/Dockerfile .
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
docker push ${DOCKER_REPOSITORY}:${VERSION}
docker push ${DOCKER_REPOSITORY}:latest
Expand Down
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.build.*
.npm
.git
.husky
.github

# This is necessary so plugins can use git repos as npm deps.
# Leave this here unless you understand the implications.
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,36 @@ Go to the complete [installation instructions](https://mailchimp.com/developer/o
# API development

## What you need
* NPM >= 7 (support workspaces)

* PNPM
* Docker & docker-compose

## Install PNPM
```bash
npm i -g pnpm@latest
```

## Clone and Start the source

```bash
git clone https://github.com/reactioncommerce/reaction.git
cd reaction
npm install
pnpm install
cp apps/reaction/.env.example apps/reaction/.env
```

Start dev-server with mongo on local:

```bash
## you must change MONGO_URL in the .env to mongodb://localhost:27017/reaction before start
npm run start:dev
pnpm run start:dev
```

Start dev-server with mongodb on docker
Start dev-server with mongodb on docker

```bash
docker-compose up -d
npm run start:dev
pnpm run start:dev
```

## Development Flow
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile → apps/reaction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /app
COPY ./apps/reaction ./apps/reaction
COPY .npmrc .nvmrc package.json pnpm-lock.yaml pnpm-workspace.yaml ./

RUN npm i -g pnpm@7
RUN npm i -g pnpm@7.11.0
RUN pnpm --filter=@reactioncommerce/reaction-api --prod deploy deps --ignore-scripts


Expand Down
Loading

0 comments on commit f7fbd83

Please sign in to comment.