25 lines
825 B
Docker
25 lines
825 B
Docker
# Use the official Memgraph image as a base
|
|
FROM memgraph/memgraph-mage:latest
|
|
|
|
# Define arguments for user and group IDs, with defaults
|
|
ARG UID=1001
|
|
ARG GID=1001
|
|
|
|
# Switch to the root user to perform administrative tasks
|
|
USER root
|
|
|
|
# Install gosu for privilege dropping
|
|
RUN sed -i 's/archive.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list.d/ubuntu.sources
|
|
RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create a new group and user with the specified UID and GID
|
|
RUN groupadd -g ${GID} user && \
|
|
useradd -u ${UID} -g ${GID} -m -s /bin/bash user
|
|
|
|
# Copy the entrypoint script and make it executable
|
|
COPY scripts/entrypoint.sh /usr/local/bin/
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
# Set the entrypoint script to be executed when the container starts
|
|
ENTRYPOINT ["entrypoint.sh"]
|