Skip to content

UXcaptain/web-app

Repository files navigation

Build & Deployment

Docker

The web app is contained and can be built from a Docker image, however, since image build and public deployment is being offloaded to Koyeb, we are building & storing the image with built-in ARGS and hosting in Docker Hub

Local deployments

The web app can be run either via:

  • Docker compose config from the server directory
  • Standalone app via own npm commands

Note: In practice, none of npm commands should be used directly since the webapp should be spawned via the server's docker compose which includes the environmental variables

  • npm run docker-build:local will build a local docker container - Should probably never be used since local development is spawned using docker compose via the server repository

  • npm run build is used by the Dockerfile to build the app

  • npm run docker-build:prod will build the Docker image for the latest branch and push it to Docker Hub

  • npm run docker-build:prod will build the Docker image for the nextbranch and push it to Docker Hub

  • npm run start:local would run the webapp as a standalone app but there is no .env file since we are using docker

HMR (Hot module replacement) in development - # TODO

TODO -- Ideally there is hot module reload when running the webapp from docker compose

To use HMR, we are running the webapp service in Docker compose with vite build # FIX

Production & Dev deployments

Deployments are triggered by pushing or merging to next and latest branches.

When new code is pushed to either branch, Koyeb which will:

  • Build the Docker Image using the DockerFile
  • Inject the build ARGS at build time
  • Deploy the app & make it accessible

Koyeb - easy to configure & serverless infrastructure running on AWS under the hood

Making the app available publicly

The publicly available branches - next & latest - are served using Nginx in Koyeb

Build ARGS

Since the webapp is being built with Vite - all environmental variables must be set as ARGS during build time

ARGS for deployments are set up in the Koyeb Project Configuration Environmental Variables configuration

Direct access to services in Koyeb:

An example list of env variables can be found in .env.example in the root directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages