Giter Site home page Giter Site logo

danghungithp / wagtail_nuxt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ordigital/wagtail_nuxt

0.0 0.0 0.0 29.42 MB

Dockerized Wagtail 4 backend with NuxtJS 3 frontend using GraphQL and Apollo for API and Vuetify 3 for templates.

Shell 0.75% JavaScript 52.71% Python 2.73% TypeScript 0.30% CSS 40.80% HTML 1.71% Vue 0.56% Dockerfile 0.44%

wagtail_nuxt's Introduction

Dockerized Wagtail 4 + NuxtJS 3 + Graphene 3 + Vuetify 3

wagtail_nuxt banner

For developement:

1. Clone repository

$ git clone [email protected]:ordigital/wagtail_nuxtjs.git && cd wagtail_nuxtjs

2. Build Docker images

Execute this command to build Docker images with access to local frontend and backend folders (see docker-compose.yml). This way live changes in code would be possible (needs at least 2GB free space):

$ ./run dev

3. Create Wagtail superuser

Execute this command in console while docker dev images are running to be able to run ./manage.py:

$ ./run wag

4. Test if http endpoints are working

Open Wagtail admin panel to add some subpages to Home with News Page type. Then open frontend to test if GraphQL api is fetching data.

You can also install Vue.js devtools and Apollo Client Tools for Chrome/Brave to make your work easier.


For production:

1. Run containers for production

$ ./run prod

2. Test if Nginx proxy responds

2. Customize settings

If everything went well, stop container and edit backend/backend/.env to set important variables. Now you can build again and use images for production server.

3. Export files

Run command below to create wagtail_nuxt_production.tar.gz file with everything you need to deploy on server:

  • Wagtail with Gunicorn Docker image (port 7999)
  • Wagtail static files directory
  • Wagtail database db.sqlite3
  • Wagtail .env file
  • Nginx public static files
  • Nginx sample proxy file.
$ ./run save

4. Deploy on server

  • Use docker load -i ./wagtail_gunicorn.tar to import docker image.
  • Create vhost config based on nginx.conf.
  • Copy /static and /public to where nginx proxy would get them from.
  • Use docker run with exec command ./docker-entrypoint.prod.sh to start container from image.

Remember you must bind some source files because db.sqlite3 and .env is not in docker image!!!

Example:

docker run -d \
     --name wagtail  \
     --mount type=bind,source=/LOCAL/db.sqlite3,target=/app/db.sqlite3 \
     --mount type=bind,source=/LOCAL/.env,target=/app/backend/.env \
     --restart=unless-stopped \
     -p 7999:7999 \
     wagtail_nuxt_web \
     ./docker-entrypoint.prod.sh

Enjoy! :)

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.