From 54c8d5b7b89c46a9df2881f8d55d4273e3f22d89 Mon Sep 17 00:00:00 2001 From: jonezy35 <103131545+jonezy35@users.noreply.github.com> Date: Thu, 11 May 2023 09:55:53 -0400 Subject: [PATCH] Added Dev Container (#1023) --- CONTRIBUTING.md | 12 ++++++++++++ Dockerfile | 11 +++++++++++ docker-compose.yml | 16 ++++++++++++++++ docker-start.sh | 13 +++++++++++++ upcoming-release-notes/1023.md | 6 ++++++ 5 files changed, 58 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docker-start.sh create mode 100644 upcoming-release-notes/1023.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d090e7a4e2..dbfb038ce1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,3 +32,15 @@ We welcome all contributions from the community. If you have an idea for a featu If you do not have ideas what to build: the issue list is always a good starting point. Look for issues labeled with "[help wanted](https://github.com/actualbudget/actual/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)". For first time contributions you can also filter the issues labeled with "[good first issue](https://github.com/actualbudget/actual/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)". + + +## Development Environment +If you would like to contribute you can fork this repository and create a branch specific to the project you are working on. + +There are two options for developing: +1. Yarn + - This is the traditional way to get an envrionment stood up. Run `yarn` to install the dependencies followed by `yarn start:browser` to start the development server. You will then be able to access Actual at `localhost:3001`. +2. Docker Compose + - If you prefer to work with docker containers, a `docker-compose.yml` file is included. Run `docker compose up -d` to start Actual. It will be accessible at `localhost:3001`. + +Both options above will dynamically update as you make changes to files. If you are making changes to the front end UI, you may have to reload the page to see any changes you make. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..afa01e9b83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +################################################### +# This Dockerfile is used by the docker-compose.yml +# file to build the development container. +# Do not make any changes here unless you know what +# you are doing. +################################################### + +FROM node:16-bullseye as dev +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y openssl +WORKDIR /app +CMD ["sh", "./docker-start.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..566adbf2f0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +################################################### +# This creates and stands up the development +# docker container. Depends on the Dockerfile and +# docker-start.sh files. +################################################### + +services: + actual-development: + build: . + image: actual-development + ports: + - '3001:3001' + volumes: + - '.:/app' + restart: no + diff --git a/docker-start.sh b/docker-start.sh new file mode 100644 index 0000000000..a8f991a20a --- /dev/null +++ b/docker-start.sh @@ -0,0 +1,13 @@ +##################################################### +# This startup script is used by the docker container +# to check if the node_modules folder is empty and +# if so, run yarn to install the dependencies. +##################################################### + +#!/bin/sh + +if [ ! -d "node_modules" ] || [ "$(ls -A node_modules)" = "" ]; then + yarn +fi + +yarn start:browser diff --git a/upcoming-release-notes/1023.md b/upcoming-release-notes/1023.md new file mode 100644 index 0000000000..3d9a37ca31 --- /dev/null +++ b/upcoming-release-notes/1023.md @@ -0,0 +1,6 @@ +--- +category: Features +authors: [jonezy35] +--- + +Created development docker container