Giter Site home page Giter Site logo

sitediff-site's Introduction

Sitediff-Site

Deployment

docker-compose up --build -d prod

You may then access the site by visiting https://localhost:18180

Development

docker-compose up --build -d dev
docker-compose exec dev yarn install
docker-compose exec dev gulp build

You may then visit http://localhost:18180 to access the site.

Two containers are defined in docker-compose.yml. One for the purpose of production and/or distributing this site as a docker image independent of any code. This is referrer to as prod. It does not mount volumes, all code lives as a static assets within the image. Code is compiled by Docker during the build process and assets used only for the purpose of compiling are discarded and not committed in the resulting image. Updates to the code require a rebuild of the image.

A second container for the purpose of development referred to as dev. This container includes the build dependencies of npm/yarn and gulp. Here we mount the codebase in ./code and can run gulp watch to actively develop the site by modifying the contents of the code directory. Hard refreshing the page in the browser will then update the site.

Opening a Shell in the Dev Container

docker-compose exec dev sh

Notes: npm install does not work in volume mounts. Instead we must use yarn install in it's place. yarn version locks dependencies with the yarn.lock file. To install the latest version of these dependencies while still respecting the version constrains in package.json run yarn upgrade within the container.

Layout

All custom code goes into code/src/ folder. The web/ folder is generated during the build process and is excluded from the repo.

  • code/src
    • images
    • pug
    • sass

Gulp

To run gulp watch open a dedicated terminal window and run the below command. Once you are done you may run Ctrl + C to exit gulp watch.

docker-compose exec dev gulp watch

Images

All images/assets such as .png .jpg .svg goes into this folder. It will be copied over to web/images on build.

Pug

Template engine Pug will be used to generate HTML. All files within root of code/src/pug/ directory will be made into a .html file of the same name over the web folder and can be accessed by visiting http://localhost/<file_name>.html. All internal folders won't be compiled and will serve only as resources for includes. gulp watch will watch for changes in any .pug file in src/pug or it's subfolders.

Sass

Gulp will compile only code/src/sass/styles.scss into web/css/styles.css. This file should only have includes for other resources. Gulp watch will trigger for changes in any .scss file in src/sass/ or it's subfolders.

sitediff-site's People

Contributors

mic79 avatar wucris avatar renanpsource avatar shahinam avatar dergachev avatar dependabot[bot] avatar

Watchers

 avatar Suzanne Dergacheva avatar  avatar James Cloos avatar SANOGO Zié Ahmed avatar Kirk Brown avatar Diego Castro avatar Jesse Dyck avatar  avatar  avatar

sitediff-site's Issues

swiper build dep fail

git clone ...
cd sitediff-public-website
npm install 


Alexs-MacBook-Pro:sitediff-public-website dergachev$ gulp build
[17:12:24] Using gulpfile ~/code/sitediff-public-website/gulpfile.js
[17:12:24] Starting 'build'...
[17:12:24] Starting 'vendor'...
[17:12:24] 'vendor' errored after 21 ms
[17:12:24] Error: File not found with singular glob: /Users/dergachev/code/sitediff-public-website/node_modules/swiper/dist/js/swiper.min.js (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (/Users/dergachev/code/sitediff-public-website/node_modules/glob-stream/readable.js:84:17)
    at Object.onceWrapper (events.js:273:13)
    at Glob.emit (events.js:182:13)
    at Glob.EventEmitter.emit (domain.js:442:20)
    at Glob._finish (/Users/dergachev/code/sitediff-public-website/node_modules/glob/glob.js:197:8)
    at done (/Users/dergachev/code/sitediff-public-website/node_modules/glob/glob.js:182:14)
    at Glob._processSimple2 (/Users/dergachev/code/sitediff-public-website/node_modules/glob/glob.js:688:12)
    at /Users/dergachev/code/sitediff-public-website/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/Users/dergachev/code/sitediff-public-website/node_modules/glob/glob.js:772:12)
    at lstatcb_ (/Users/dergachev/code/sitediff-public-website/node_modules/glob/glob.js:764:12)
[17:12:24] 'build' errored after 24 ms

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.