-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathDockerfile.template
38 lines (32 loc) · 1.19 KB
/
Dockerfile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# https://nodejs.org/en/about/releases/
# https://github.com/nodejs/Release#readme
FROM node:{{ env.variant }}
RUN set -eux; \
apk add --no-cache \
bash \
# grab tini for signal processing and zombie killing
tini
WORKDIR /app
ARG MONGO_EXPRESS_REPOSITORY=mongo-express/mongo-express
ARG MONGO_EXPRESS_VERSION=release/v{{ .version }}
RUN set -eux; \
apk add --no-cache --virtual .me-fetch-deps git; \
git clone --depth 1 --branch "$MONGO_EXPRESS_VERSION" -c advice.detachedHead=false https://github.com/$MONGO_EXPRESS_REPOSITORY.git .; \
export DISABLE_V8_COMPILE_CACHE=1; \
yarn install; \
yarn build; \
yarn remove --all; \
yarn workspaces focus --production; \
yarn cache clean; \
apk del --no-network .me-fetch-deps; \
rm -rf .git* ~/.cache ~/.yarn
# override some config defaults with values that will work better for docker
ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \
ME_CONFIG_SITE_SESSIONSECRET="secret" \
ME_CONFIG_BASICAUTH=true \
VCAP_APP_HOST="0.0.0.0"
EXPOSE 8081
COPY docker-entrypoint.sh /
ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["mongo-express"]