dev/README.md

Development workflow

Pre-reqs

The development process for this application requires the following to be set up: A local (or container) version of MongoDB installed and available. This could be installed directly on your development machine, or running as a docker container. If interested in the container version, see the service entry in the .devcontainer/docker-compose.yml file. Ability to build the application as a Docker container. The build file instructions are contained in the Dockerfile file in the root of the repository. If using a hosted version of MongoDB in the cloud (for instance Digital Ocean), add any necessary files for authentication such as certificates in the deploy_files directory at the root of the repo. In this case, the file is called ca-certificate.crt. Create both a .Renviron and .env files that host specific environment variables that will be used to connect to MongoDB. See the corresponding .Renviron.example and .env.example for the expected syntax. Set up an account on Docker Hub and create a Docker Hub repo to host your container image. In this example, the repo is called rpodcast/rphquizplay If using Digital Ocean to host the application, you will need an account on that service.

In-app Development

options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode
Sys.setenv("GOLEM_CONFIG_ACTIVE" = "dev")
# copy cert file
RUN mkdir /deploy_files
RUN cp /build_zone/deploy_files/ca-certificate.crt /deploy_files/ca-certificate.crt
RUN rm /build_zone/.Rprofile
RUN rm -rf /build_zone/renv
docker run --env-file=.env -p 5557:80 --name rphlocal rphquiz

Where rphlocal is a name for the running container (can be any string)



rpodcast/rph.quiz documentation built on Nov. 9, 2022, 7:20 a.m.