-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
34 lines (25 loc) · 1.1 KB
/
Dockerfile
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
ARG MONGODBVERSION=4.0.12
FROM bitnami/mongodb:${MONGODBVERSION}
# Define build arguments
ARG ARG_REF_ENSEMBL_VERSION
ENV REF_ENSEMBL_VERSION=${ARG_REF_ENSEMBL_VERSION}
ARG SPECIES=homo_sapiens
# Define additional annotation resources arguments
ARG MUTATIONASSESSOR=false
USER root
# Create directories for scripts and data storage and copy data to directory inside the container
RUN mkdir -p /scripts /data
COPY data/ /data/
COPY scripts/startup.sh /scripts/
# Make all scripts in the /scripts directory executable
RUN chmod +x /scripts/*.sh
# Change ownership of the /data directory and its contents to non-root user 1001
RUN chown -R 1001 /data
# Switch to the non-root user
USER 1001
# Copy the MongoDB initialization script into the /docker-entrypoint-initdb.d/ directory
# This directory is automatically scanned and executed by MongoDB during the first database initialization
COPY scripts/import_mongo.sh /docker-entrypoint-initdb.d/
# Set the default command to execute the custom startup script when the container runs
# The startup script arranges the setup and start of MongoDB
CMD [ "/scripts/startup.sh" ]