Update dockerfile

This commit is contained in:
Ryan 2025-04-09 23:17:25 +10:00
parent 5d5a0bf390
commit d858e0af50
2 changed files with 8 additions and 9 deletions

View File

@ -1,14 +1,14 @@
FROM node:20-alpine
FROM node:20-bullseye-slim
# Set working directory in the container.
# Install Git during the build phase using apt.
RUN apt-get update -y && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Set working directory.
WORKDIR /app
# Copy the entrypoint script into /app and make it executable.
# Copy your entrypoint script.
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# (Optional) You might also want to copy other files that your Medusa app may need,
# but in this case, the project is created during runtime and stored in a persistent volume.
# Set the default command to run the entrypoint script.
# Set the default command.
CMD ["/app/entrypoint.sh"]

View File

@ -3,8 +3,6 @@ set -ex
echo "Starting entrypoint script..."
# Update apt repository, install git, and remove apt cache
apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
echo "Git version: $(git --version)"
PROJECT_DIR="/app/my-medusa-app"
@ -12,6 +10,7 @@ PROJECT_DIR="/app/my-medusa-app"
# Check if the Medusa project has already been created.
if [ ! -d "$PROJECT_DIR" ]; then
echo "Medusa project not found. Running installation..."
echo "Git version: $(git --version)"
# Run the Medusa CLI generator silently with the desired options:
npx create-medusa-app@latest my-medusa-app \