Requirements: a server with:
- the latest version of Node.js and NPM
- Docker and Docker Compose installed
First, clone this directory on a server:
git clone https://github.com/rollmug/mhs-accessibility-app.git
# then:
cd mhs-accessibility-app
npm installIn the project root directory, create a file called .env.local and add the following text, configuring the first three URLs as needed:
GRAPHQL_URL=https://path-to-directus/graphql
FILES_BASE_URL=https://path-to-directus/assets
NEXT_PUBLIC_FILES_BASE_URL=https://path-to-directus/assets
CACHE_DELAY=100 # in seconds
VIRTUAL_HOST=some.domain.com
VIRTUAL_PORT=3000
LETSENCRYPT_HOST=some.domain.com
LETSENCRYPT_EMAIL=you@email.comBe sure to check the next.config.mjs file for remote patterns, which lists the allowed domains and protocols for remote assets.
To run the development server in Node (for testing):
npm run devOpen http://localhost:3000 with your browser to see the result.
For production use, run the following command:
docker compose up -d --buildCreate a .env file in this directory the contains the settings for:
VIRTUAL_HOST=some.domain.com
VIRTUAL_PORT=3000
LETSENCRYPT_HOST=some.domain.com
LETSENCRYPT_EMAIL=you@email.com(Note: this is separate from the .env.local file, which must also exist.)
docker compose -f docker-compose.dev.yml up -d --buildOpen http://localhost:3000 with your browser to see the result
cdto the project root directory.- stop the running services (ie,
docker-compose down). - Run
git pull. - Start services again:
docker-compose up -d --build
Install this project in a directory that contains an existing docker-compose file, as above. Then include the following in the existing docker-compose file:
services:
# other services etc...
collected-mohistory:
container_name: collected-mohistory
build:
context: .
restart: always
environment:
NODE_ENV: production
env_file:
- .env.local
ports:
- 3000:3000
# networks:
# any networks here, if needed
# rest of compose file...When launching, make sure you include the build commnad:
docker compose up -d --buildTo build directly from git, use the following in your docker-compose file:
services:
# other services etc...
cosmic-playlist:
container_name: cosmic-playlist
build: https://github.com/rollmug/mhs-accessibility-app.git
restart: always
environment:
NODE_ENV: production
env_file:
- .env.local
ports:
- 3000:3000
# networks:
# any networks here, if needed
# rest of compose file...