17 lines
369 B
17 lines
369 B
## Note: alpine version >= 3.9 is required to get mongodb version 4
|
|
## is a simple copy of alpine:3.9
|
|
FROM docker.0k.io/alpine:3.9 as common
|
|
|
|
RUN apk add --no-cache mongodb
|
|
|
|
RUN mkdir -p /var/lib/mongod
|
|
RUN chown -R mongodb:mongodb /var/lib/mongod
|
|
|
|
VOLUME ["/var/lib/mongodb"]
|
|
EXPOSE 27017 28017
|
|
|
|
USER mongodb
|
|
|
|
ENTRYPOINT [ "mongod", "--config", "/etc/mongod.conf" ]
|
|
|
|
|