Update dockerfile
This commit is contained in:
parent
5d5a0bf390
commit
d858e0af50
14
Dockerfile
14
Dockerfile
@ -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
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the entrypoint script into /app and make it executable.
|
# Copy your entrypoint script.
|
||||||
COPY entrypoint.sh /app/entrypoint.sh
|
COPY entrypoint.sh /app/entrypoint.sh
|
||||||
RUN chmod +x /app/entrypoint.sh
|
RUN chmod +x /app/entrypoint.sh
|
||||||
|
|
||||||
# (Optional) You might also want to copy other files that your Medusa app may need,
|
# Set the default command.
|
||||||
# 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.
|
|
||||||
CMD ["/app/entrypoint.sh"]
|
CMD ["/app/entrypoint.sh"]
|
||||||
|
|||||||
@ -3,8 +3,6 @@ set -ex
|
|||||||
|
|
||||||
echo "Starting entrypoint script..."
|
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)"
|
echo "Git version: $(git --version)"
|
||||||
|
|
||||||
PROJECT_DIR="/app/my-medusa-app"
|
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.
|
# Check if the Medusa project has already been created.
|
||||||
if [ ! -d "$PROJECT_DIR" ]; then
|
if [ ! -d "$PROJECT_DIR" ]; then
|
||||||
echo "Medusa project not found. Running installation..."
|
echo "Medusa project not found. Running installation..."
|
||||||
|
echo "Git version: $(git --version)"
|
||||||
|
|
||||||
# Run the Medusa CLI generator silently with the desired options:
|
# Run the Medusa CLI generator silently with the desired options:
|
||||||
npx create-medusa-app@latest my-medusa-app \
|
npx create-medusa-app@latest my-medusa-app \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user