GithubHelp home page GithubHelp logo

toolkit-docker's Introduction

Docker Compose Setup for WordPress and Node.js with Hawaii Interactive Toolkit

This Docker Compose configuration sets up a development environment with WordPress, MySQL, Node.js, and Adminer. It allows you to develop WordPress themes and Node.js applications simultaneously.

Prerequisites

Before using this Docker Compose setup, make sure you have the following installed:

Usage

  1. Clone this repository to your local machine:

  2. Create a .env file in the root directory of the cloned repository with the following environment variables:

    MYSQL_ROOT_PASSWORD=your-mysql-root-password
    WORDPRESS_DB_NAME=your-wordpress-db-name
    WORDPRESS_DB_USER=your-wordpress-db-user
    WORDPRESS_DB_PASSWORD=your-wordpress-db-password
    WORDPRESS_TITLE=your-wordpress-title
    WORDPRESS_USER=your-wordpress-admin-user
    WORDPRESS_PASSWORD=your-wordpress-admin-password
    WORDPRESS_EMAIL=your-wordpress-admin-email
    ACF_KEY=your-acf-pro-key

    Replace your-mysql-root-password, your-wordpress-db-name, your-wordpress-db-user, your-wordpress-db-password, your-wordpress-title, your-wordpress-admin-user, your-wordpress-admin-password, your-wordpress-admin-email, and your-acf-pro-key with your desired values.

  3. Start the Docker Compose services:

    docker-compose up -d
  4. Access the following services:

WordPress Setup

The WordPress setup is automated using a custom entrypoint script located in ./srcs/wordpress/entrypoint.sh. The script performs the following actions:

  • Downloads the WordPress core in French locale
  • Creates a WordPress configuration with the provided database credentials
  • Resets the WordPress database
  • Installs WordPress with the specified admin user and email
  • Sets the website to private mode (blog_public = 0)
  • Installs and activates the ACF Pro plugin using the provided ACF_KEY
  • Installs and activates the UpdraftPlus plugin
  • Restores and enables a custom-made theme named "toolkit" placed in ./srcs/themes/toolkit
  • Sets the correct permissions for the theme files
  • Starts the WordPress server

Node.js Setup

The Node.js setup is automated using a custom entrypoint script located in ./srcs/nodejs/entrypoint.sh. The script performs the following actions:

  • Installs the Node.js application dependencies using npm install
  • Checks the project type (webpack or gulp) and runs the appropriate scripts:
    • If the project type is webpack, it starts the server in production mode (npm run production) or watch mode (npm run watch) based on the NODE_ENV environment variable.
    • If the project type is gulp, it installs Gulp dependencies (gulp install) and starts the watch task (npm run watch).

Customization

You can customize the Docker Compose setup to suit your specific needs:

  • Change the WordPress theme: Replace the custom-made "toolkit" theme in ./srcs/themes/toolkit with your own WordPress theme.
  • Modify Node.js application: Place your Node.js application files in the ./srcs/nodejs directory and adjust the Dockerfile accordingly.
  • Change environment variables: Adjust the .env file to provide appropriate environment variable values.

Notes

  • This Docker Compose setup is intended for local development purposes. In a production environment, additional configurations and security measures are required.

toolkit-docker's People

Contributors

marjc5 avatar martin-woolstenhulme avatar

Watchers

 avatar

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.