try for mount
Build and Push Docker Images / build-and-push (push) Successful in 20s

This commit is contained in:
2025-05-08 16:51:23 +02:00
parent 65825b4ad9
commit d3888cf96e
3 changed files with 21 additions and 2 deletions
+7 -2
View File
@@ -14,8 +14,12 @@ COPY ./strapi/package.json ./strapi/package-lock.json ./
# Install all dependencies (including devDependencies) # Install all dependencies (including devDependencies)
RUN npm ci RUN npm ci
# Copy the rest of the Strapi app # Copy the rest of the Strapi app to a template directory
COPY ./strapi ./ COPY ./strapi /opt/app-template
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV DATABASE_CLIENT=postgres ENV DATABASE_CLIENT=postgres
ENV DATABASE_NAME=strapi ENV DATABASE_NAME=strapi
@@ -34,4 +38,5 @@ ENV ALLOWED_HOSTS=localhost
EXPOSE 1337 EXPOSE 1337
ENTRYPOINT ["/entrypoint.sh"]
CMD ["npm", "run", "develop"] CMD ["npm", "run", "develop"]
+2
View File
@@ -19,6 +19,8 @@ services:
- "1337:1337" - "1337:1337"
depends_on: depends_on:
- postgres - postgres
volumes:
- ./data/strapi-app:/opt/app
postgres: postgres:
image: postgres image: postgres
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# If /opt/app/package.json does not exist, copy the app skeleton into /opt/app
if [ ! -f /opt/app/package.json ]; then
echo "Initializing /opt/app with application files..."
cp -R /opt/app-template/* /opt/app/
cp -R /opt/app-template/.[!.]* /opt/app/ 2>/dev/null || true
fi
cd /opt/app
exec "$@"