Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker build #107

Closed
wants to merge 2 commits into from
Closed
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
.jq-template.awk
30 changes: 0 additions & 30 deletions 1.0/18-alpine3.17/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions 1.0/18-alpine3.17/docker-entrypoint.sh

This file was deleted.

30 changes: 0 additions & 30 deletions 1.0/18-alpine3.18/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions 1.0/18-alpine3.18/docker-entrypoint.sh

This file was deleted.

30 changes: 0 additions & 30 deletions 1.0/20-alpine3.17/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions 1.0/20-alpine3.17/docker-entrypoint.sh

This file was deleted.

30 changes: 0 additions & 30 deletions 1.0/20-alpine3.18/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions 1.0/20-alpine3.18/docker-entrypoint.sh

This file was deleted.

21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:20-alpine

RUN apk -U add --no-cache bash git

ARG MONGO_EXPRESS_VERSION=master

# override some config defaults with values that will work better for docker
ENV ME_CONFIG_MONGODB_ENABLE_ADMIN="true"
ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017"
ENV ME_CONFIG_SITE_SESSIONSECRET="secret"
ENV VCAP_APP_HOST="0.0.0.0"

RUN git clone --depth 1 --branch $MONGO_EXPRESS_VERSION https://github.com/mongo-express/mongo-express.git /app

WORKDIR /app

RUN yarn install
RUN yarn build

EXPOSE 8081
ENTRYPOINT ["npm", "start"]
24 changes: 0 additions & 24 deletions Dockerfile.template

This file was deleted.

36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ mongo-express is a web-based MongoDB admin interface written in Node.js, Express

# How to use this image

```console
$ docker run --link some_mongo_container:mongo -p 8081:8081 -e ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" mongo-express
```bash
docker run --rm --link some_mongo_container:mongo -p 8081:8081 -e ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" mongo-express
```

Then you can hit `http://localhost:8081` or `http://host-ip:8081` in your browser.
Expand Down Expand Up @@ -61,28 +61,22 @@ The following are only needed if `ME_CONFIG_MONGODB_ENABLE_ADMIN` is **"false"**

This example links to a container name typical of `docker-compose`, changes the editor's color theme, and enables basic authentication.

# How to build this image
# How to build and run this image locally

```console
docker build --tag mongo-express .
```

## Custom tag
Start a mongodb server:

`MONGO_EXPRESS_TAG` can be substituted with the tag you want to build. ie:

```console
docker build \
--build-arg MONGO_EXPRESS_TAG=v1.2.3-rc \
--tag mongo-express .
```bash
docker run --rm -p 27017:27017 mongo:latest
```

## Custom Repository
Build and run the mongo-express image:

`MONGO_REPOSITORY` can be substituted with a forked version of Mongo Express. ie:
```bash
# Build
docker build --tag mongo-express .
## or to build with a specific version of mongo-express
docker build --build-arg MONGO_EXPRESS_VERSION=v1.0.2 --tag mongo-express .

```console
docker build \
--build-arg MONGO_REPOSITORY=OtherUser/mongo_express \
--tag mongo-express .
```
# Run
docker run --rm -p 8081:8081 -e ME_CONFIG_MONGODB_URL="mongodb://host.docker.internal:27017" mongo-express
```
Loading