GithubHelp home page GithubHelp logo

woollysammoth / sveltekit-docker-nginx Goto Github PK

View Code? Open in Web Editor NEW
42.0 2.0 7.0 58 KB

SvelteKit example project with local HMR + SSL using Docker + NGINX

Shell 57.17% JavaScript 21.45% Dockerfile 6.25% TypeScript 8.49% HTML 4.86% Svelte 1.79%
docker-compose hmr nginx-reverse-proxy ssl sveltekit docker nginx svelte vite

sveltekit-docker-nginx's Introduction

SvelteKit Docker NGINX

SvelteKit-Docker-NGINX

This template allows you to have NGINX proxy requests to your SvelteKit app,
while keeping Hot Module Replacement (HMR) and SSL functional with your development environment.

Features

setup-server.sh

  • Installs Docker/Compose dependencies and enables HTTP/HTTPS traffic

setup-ssl.sh

  • This script allows production NGINX to start by creating the requisite dummy Certbot certificate, starting NGINX and finally replacing the dummy certificate with a live certificate. This prevents us from having to modify NGINX's production default.conf when deploying.

USE_POLLING/CHOKIDAR_USEPOLLING

  • true - Windows development environment (fixes an issue with endless HMR reloads)
  • false - Mac/Linux development environment

Usage

Development

  • Create a private key and certificate using mkcert
    • mkcert -install -key-file local.key.pem -cert-file local.cert.pem localhost foo.local
      
    • nginx/dev/local.cert.pem & nginx/dev/local.key.pem need to be created
    • On Mac OS, add key to system keychains in Keychain Access

Production

  • Replace example.com with your domain name in:
    • nginx/prod/default.conf
    • setup-ssl.sh
  • Replace [email protected] with your email address in setup-ssl.sh
  • chmod +x setup-server.sh setup-ssl.sh
  • sudo ./setup-server.sh
  • sudo ./setup-ssl.sh
  • docker compose up --build --force-recreate -d

sveltekit-docker-nginx's People

Contributors

woollysammoth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sveltekit-docker-nginx's Issues

Missing file in production build...

Hello I am trying to run prod environment, but I am getting this error inside my container, nginx keeps restarting, and I can't figure it out why, do you have any idea, why am i missing this certificate file ??

2023-02-22T19:46:06.274570699Z 2023/02/22 19:46:06 [emerg] 1#1: cannot load certificate "/etc/letsencrypt/live/wings-blog.com/fullchain.pem": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/letsencrypt/live/wings-blog.com/fullchain.pem, r) error:10000080:BIO routines::no such file)

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.