All Projects → heydemoura → docker-bare-infra

heydemoura / docker-bare-infra

Licence: MIT license
Docker based, minimal infrastructure boilerplate, with MySQL, WordPress, a React application and Nginx

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to docker-bare-infra

Egg Vue Webpack Boilerplate
Egg Vue Server Side Render (SSR) / Client Side Render (CSR)
Stars: ✭ 1,302 (+11736.36%)
Mutual labels:  isomorphic, server-side-rendering
webpack-isomorphic
A lightweight solution for the server-side rendering of Webpack-built applications.
Stars: ✭ 21 (+90.91%)
Mutual labels:  isomorphic, server-side-rendering
Marko
A declarative, HTML-based language that makes building web apps fun
Stars: ✭ 10,796 (+98045.45%)
Mutual labels:  isomorphic, server-side-rendering
Hapi React Hot Loader Example
Simple React Hot Loading example with Hapi Server-side rendering
Stars: ✭ 44 (+300%)
Mutual labels:  isomorphic, server-side-rendering
Universal React
A universal react starter, with routing, meta, title, and data features
Stars: ✭ 247 (+2145.45%)
Mutual labels:  isomorphic, server-side-rendering
Universal React Demo
ES6 demo of a simple but scalable React app with react-router, code splitting, server side rendering, and tree shaking.
Stars: ✭ 50 (+354.55%)
Mutual labels:  isomorphic, server-side-rendering
Project Webcube
Continuously updated JS infrastructure for modern web dev
Stars: ✭ 141 (+1181.82%)
Mutual labels:  isomorphic, server-side-rendering
Awesome Nextjs
📔 📚 A curated list of awesome resources : books, videos, articles about using Next.js (A minimalistic framework for universal server-rendered React applications)
Stars: ✭ 6,812 (+61827.27%)
Mutual labels:  isomorphic, server-side-rendering
Use Ssr
☯️ React hook to determine if you are on the server, browser, or react native
Stars: ✭ 230 (+1990.91%)
Mutual labels:  isomorphic, server-side-rendering
Universal React Router4
Demo app showing how to use react-router v4 for server- and client-side rendering
Stars: ✭ 216 (+1863.64%)
Mutual labels:  isomorphic, server-side-rendering
Typescript Hapi React Hot Loader Example
Simple TypeScript React Hot Loading example with Hapi Server-side rendering
Stars: ✭ 44 (+300%)
Mutual labels:  isomorphic, server-side-rendering
ves
Vue SSR(Server Side Render) Web Framework for Egg
Stars: ✭ 23 (+109.09%)
Mutual labels:  isomorphic, server-side-rendering
Universal
Seed project for Angular Universal apps featuring Server-Side Rendering (SSR), Webpack, CLI scaffolding, dev/prod modes, AoT compilation, HMR, SCSS compilation, lazy loading, config, cache, i18n, SEO, and TSLint/codelyzer
Stars: ✭ 669 (+5981.82%)
Mutual labels:  isomorphic, server-side-rendering
boldr
React based CMF / blogging engine using Redux, Postgres, Node, and more...
Stars: ✭ 78 (+609.09%)
Mutual labels:  isomorphic, server-side-rendering
React Isomorphic Boilerplate
🌟 An universal React isomorphic boilerplate for building server-side render web app.
Stars: ✭ 653 (+5836.36%)
Mutual labels:  isomorphic, server-side-rendering
Razzle Material Ui Styled Example
Razzle Material-UI example with Styled Components using Express with compression
Stars: ✭ 117 (+963.64%)
Mutual labels:  isomorphic, server-side-rendering
Redux Connect
Provides decorator for resolving async props in react-router, extremely useful for handling server-side rendering in React
Stars: ✭ 551 (+4909.09%)
Mutual labels:  isomorphic, server-side-rendering
React App
Create React App with server-side code support
Stars: ✭ 614 (+5481.82%)
Mutual labels:  isomorphic, server-side-rendering
React Imvc
An Isomorphic MVC Framework
Stars: ✭ 211 (+1818.18%)
Mutual labels:  isomorphic, server-side-rendering
Beidou
🌌 Isomorphic framework for server-rendered React apps
Stars: ✭ 2,726 (+24681.82%)
Mutual labels:  isomorphic, server-side-rendering

Docker based minimal infrastructure

Main Goal

Offer an easy way to migrate a wordpress website from a server to another, and also run a server side rendered ReactJS application.

You can use this project to easily set up or replicate a basic docker containers infrastructure, doing little adjusments to suit your needs.

How To

Dependencies

  • docker >= 1.13
  • docker-compose >= 1.13

Instructions on how to install:

TL;DR

git clone https://github.com/heydemoura/docker-bare-infra.git --depth=1 myserver && cd myserver
docker-compose up -d

MySQL setup

If you are migrating a mysql dependant application, is better if you dump your databases and put the .sql scripts inside the mysql/scripts/ directory. MySQL docker entrypoint will run any scripts inside this folder upon initialization of the mysql docker container.

You can also edit the docker-compose.yaml file if you need to set up any other environment variables or change any volumes.

If you are using Amazon Web Services, I suggest having a attached storaged only for your database volume. This way you can use the same database throughout your EC2 instances.

Nginx setup

If you have any custom Nginx configuration you need to setup, throw your configuration into the nginx/conf.d/ or nginx/default.d/ directories, docker-compose will mount theses folders as volumes of the Nginx container.

Also a nginx.conf file is located in nginx/nginx.conf that will be mounted as the container's /etc/nginx/nginx.conf file. So if you need any additional setup, edit this file.

Server Names

In case you have a simple Nginx configuration, with only one server, you can change the NGINX_HOST environment variable on docker-compose.yaml to suite your need. There is a template that will be rewritten with your default server_name for the default nginx configuration.

...
  nginx:
    image: nginx:latest
    ports:
      - "80:80"
    environment:
      NGINX_HOST: 172.18.0.1
    volumes:
      - ./nginx/conf.d/:/etc/nginx/conf.d/
      - ./nginx/default.d/:/etc/nginx/default.d/
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
    command: /bin/bash -c "envsubst < /etc/nginx/conf.d/conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
...

Wordpress setup

This is a basic wordpress setup, if you want to migrate from another server, you will have to backup your files and setup a volume on docker-compose.yaml containing you wordpress installation.

By default, this project uses /blog route on Nginx for the Wordpress installation. You can edit the nginx/default.d/blog.conf file if you want to change that (also remember to change the port in this file if you change the wordpress container port on docker-compose.yaml)

Setup your database name with the environment variables on docker-compose.yaml if you want to have a custom one, or if you are migrating from another server.

Wordpress Admin

By default, Wordpress default configuration rewrites the URL when you try to access wp-admin. For a Wordpress standalone server this is pretty OK, but for this purpose of running it on a container under a reverse proxy, this can be a pain, when you try to access /blog/wp-admin it keeps sending you to the admin but the URL is rewritten to /wp-admin.

Unfortunately I wasn't capable to setup wp-admin to preserve the URL when you access /blog/wp-admin. By default Nginx will redirect you to the container itself, accessing via the exposed port from wordpress container.

I could use Wordpress MultiSite, but for that i should be using port 80 for Wordpress, that i am not. But even in that case I could do some hacking like on this page, but this hack could be reverted by a future Wordpress update.

For the same cause, if you are performing a clean Wordpress installation, you should proceed with the installation script accessing the container itself.

Blog

  • mydomain.com:8080

Home

  • mydomain.com:8081

After the installation process, update the siteurl for the containers to be: mydomain.com/blog and mydomain.com/hom respectively. Or esle it will not work correctly.

Permalinks

In order to enable permalinks for posts, htaccess files for each wordpress container, they are located in wordpress/. For the sake of this example to work properly, copy both files to the respective containers:

docker cp wordpress/blog_htaccess myserver_blog:/var/www/html/.htaccess
docker cp wordpress/home_htaccess myserver_home:/var/www/html/.htaccess

This should enable proper permalinks rewrite rules for those containers.

...
  wordpress:
    depends_on:
      - db
    image: wordpress
    ports:
      - "8080:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
...

Super Duper Server Side Rendered React App

Small and simple React app, server side rendered using Node and Express. More details about this at the dedicated README

License

MIT © Heyde Moura

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].