npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-cli-plugin-docker-nginx-diff-proxy

v1.1.7

Published

vue-cli 3.0 plugin that sets up a nginx docker container that serves your vue app

Downloads

97

Readme

vue-cli-plugin-docker-nginx-diff-proxy

中文 | English

This plug-in is to build a docker image of multiple environment reverse proxy

This is a vue-cli-plugin that adds a minimal docker deployment (~19MB + static files) using nginx to serve your vue-app

prepare: you must have a 'build-proxy' Scripts in your package.json , and 'build-proxy' can build your app to request <proxy_prefix>

Installation

vue add vue-cli-plugin-docker-nginx-diff-proxy

This will automatically add all the files needed to your existing vue-cli project

  1. in your package.json, will add some scripts:

    • docker-build-dev

      Build development environment

    • docker-build-qa

      Build test environment

    • docker-build-pro

      Build production environment

    • docker-run-dev

      Build development environment and Start with 3000 port

    • docker-run-qa

      Build test environment and Start with 3000 port

    • docker-run-pro

      Build production environment and Start with 3000 port

  2. a nginx folder will be added to the root, It contains four files

    • default-dev.conf

      Configuration files for nginx in development environment

    • default-qa.conf

      Configuration files for nginx in test environment

    • default-pro.conf

      Configuration files for nginx in production environment

    • gzip.conf

      _Gzip is on by default,You can close it if you don't need it

  3. in your vue.conf.js,A dockerNginxProxy property will be added to pluginOptions

    • proxy_prefix

      Prefix for reverse proxy, default is '/proxy'

    • env_prefix

      Proxy address of different environment, you can add environment at will

      • dev
        Proxy address of development enviroment, default is 'http://localhost:8080'
      • qa
        Proxy address of test enviroment, default is 'http://localhost:8080'
      • pro
        Proxy address of production enviroment, default is 'http://localhost:8080'
  4. a Dockerfile will be added to the root

    • Dockerfile

      Dynamically load nginx configuration according to Env parameters

Build and run local docker container

npm run docker-run-<ENV>

This will build a docker container and run it on port 3000. If you want to run it on different port change the run script in your package.json to

  "docker-run-<ENV>": "docker run docker-build-<ENV> && docker run -d -p <PORT>:80 <your project>-<ENV>"

Please make sure to have docker installed and running on your machine.

Tweak nginx config

You will find that the three nginx configuration files generated automatically are the same, This is to increase flexibility,You can add and modify any configuration at will in different environments. You can also add templates to support more environments.