Coder Social home page Coder Social logo

bcnzer / cloudrun-cloudsql-wordpress Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 4.0 7.47 MB

WordPress instance running out of GCP Cloud Run, backed with a MySQL database in Cloud SQL

License: MIT License

Dockerfile 0.01% PHP 47.59% CSS 10.20% JavaScript 40.75% TSQL 0.02% HTML 1.39% Shell 0.04%

cloudrun-cloudsql-wordpress's Introduction

cloudrun-cloudsql-wordpress's People

Contributors

bcnzer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cloudrun-cloudsql-wordpress's Issues

"RUN chmod +x /usr/local/bin/cloud-run-entrypoint.sh" is need in Dockerfile

I tried to deploy this code, but this error was occured when I run setup.sh.

Deploying container to Cloud Run service [wordpress] in project [xxxxx-xxxxx-xxxxx] region [us-central1]
โ ถ Deploying new service... Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
error: "Command \"cloud-run-entrypoint.sh\": invalid mode \"-rw-r--r--\" for /usr/local/bin/cloud-run-entrypoint.sh"
].. Routing traffic...
  X Creating Revision... Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
X Deploying new service... Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
error: "Command \"cloud-run-entrypoint.sh\": invalid mode \"-rw-r--r--\" for /usr/local/bin/cloud-run-entrypoint.sh"
].



Deployment failed
ERROR: (gcloud.run.deploy) Invalid ENTRYPOINT. [name: "gcr.io/xxxxx-xxxxx-xxxxx/wordpress@sha256:b71d07578155a74007b8ff1c6fe7e62c71080380897fe04c086221c598fdd686"
error: "Command \"cloud-run-entrypoint.sh\": invalid mode \"-rw-r--r--\" for /usr/local/bin/cloud-run-entrypoint.sh"
].

So I added RUN chmod +x /usr/local/bin/cloud-run-entrypoint.sh in Dockerfile bellow COPY wordpress/cloud-run-entrypoint.sh /usr/local/bin/, it works.

Dockerfile

# See https://hub.docker.com/_/wordpress/ for the latest
FROM wordpress:5.3.2-php7.4-apache

EXPOSE 8080
# Use the PORT environment variable in Apache configuration files.
RUN sed -i 's/80/${PORT}/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
# wordpress conf
COPY wordpress/wp-config.php /var/www/html/wp-config.php

# Copy WordPress THEMES
COPY themes /usr/src/wordpress/wp-content/themes/

# Copy WordPress PLUGINS
COPY plugins /usr/src/wordpress/wp-content/plugins/

# download and install cloud_sql_proxy
RUN apt-get update && apt-get install curl
RUN curl -o /usr/local/bin/cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 && chmod +x /usr/local/bin/cloud_sql_proxy

# custom entrypoint
COPY wordpress/cloud-run-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/cloud-run-entrypoint.sh


ENTRYPOINT ["cloud-run-entrypoint.sh","docker-entrypoint.sh"]
CMD ["apache2-foreground"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.