You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the sake of development, please also have Golang installed on your local machine and yarn as a your JS package manager.
28
28
29
-
### Setting up environment variables
30
-
31
-
All tokens are being treated as environment variables and are purposely left out of the GitHub repository. The easiest way is to inject these secrets into the container as environment variables.
32
-
33
-
Contact the website project lead to get the tokens sent directly to you via secure mediums.
34
-
35
-
Docker expects a file named `.env` in the root directory of the project containing environment variables in the following format:
36
-
37
-
```text
38
-
{variable_name}={variable_value}
39
-
```
40
-
41
-
Here is a sample valid `.env` file:
42
-
43
-
```text
44
-
ENV_VAR1=0123456789
45
-
ENV_VAR2=super_secure_secret
46
-
```
47
-
48
-
These environment variables are only reacheable during the building process of the Docker containers, not in the container themselves (by default). To pass them into their relevant container the `docker-compose.yml` file specifies the required env variables under the *environment* field for each service. Please read the section on [Security](#security).
49
-
50
29
### Installing
51
30
52
-
*Please check back regularly as deployment steps may change at any point within these early stages of development. Thank you for your patience.*
53
-
54
31
With the repo cloned, proceed to checkout to the dev branch.
55
32
56
33
From the root folder of the dev branch, run the following command in your terminal.
57
34
58
35
```script
59
-
docker-compose up -d --build
36
+
docker-compose -f docker-compose-dev.yml up -d --build
60
37
```
61
38
62
39
This will automatically build the images required for the containers, as well as the containers for the first time. After this images will not need to be built again until changes have been made to the dependencies. For subsequent runs, remove the `--build`.
63
40
64
-
The '-d' is to start the container in the background and leave them running. There will be three containers that start up `frontend`, `backend` and `mongo`. Once you are finished developing, run:
41
+
The '-d' is to start the container in the background and leave them running. There will be three containers that start up `frontend`, `backend` and `mongo`.
42
+
Note: once you have built the containers from here, you can do most docker operations from the UI such as starting/stopping the containers. You will only *need* to do this for your first setup or if you delete the containers / purge your docker data.
43
+
44
+
If you would rather use the commandline, once you are finished developing, run:
65
45
66
46
```script
67
47
docker-compose down -v
68
48
```
69
49
70
50
which kills your containers and removes any bind mounts and named volumes but keeps your images. Be sure to use `docker-compose --help` for any additional help or other options.
71
51
52
+
You can also run just
53
+
```script
54
+
docker-compose down
55
+
```
56
+
57
+
if you want to erase your images from docker too (which can save some disk space).
58
+
59
+
You may want to be wary of docker as it is *extremely resource hungry*. It can occupy several gigs of RAM and will noticably cause increased battery drainage because it is constantly making use of the CPU. For your sanity you may want to make sure you *stop all containers and shut docker down* if you aren't working on the repo for your own sanity - if you have 32gb of RAM or greater <and aren't using battery power> this probably won't be an issue.
60
+
72
61
To access the website, the static files will be served on `0.0.0.0:8080` (`[::]:8080`) while the backend APIs are served on `0.0.0.0:1323` (`[::]:1323`). Make sure when you are making calls from the frontend to the backend in development stage, you use the suffix of the api call and not call with the domain e.g
73
62
74
63
```javascript
@@ -136,18 +125,6 @@ To simplify things we are using environment variables instead of Docker Secrets.
136
125
*[Golang](https://golang.org/) - Used to write the API and server backend.
137
126
*[Swagger](https://swagger.io/) - API documentation framework
138
127
139
-
## System Architecture
140
-
141
-
For more on the system's architecture, please head to the [confluence page](https://compclub.atlassian.net/wiki/spaces/Projects/pages/845414415/Architectural+Guide).
142
-
143
-
## Contributing
144
-
145
-
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
146
-
147
-
## Authors
148
-
149
-
***Tommy Truong** - *Initial work for README.md file* - [glebme](https://github.com/glebme)
150
-
***Sergio Mercado Ruiz** - *Setting up environment variables, API Documentation and Security sections.* - [sergiomercado19](https://github.com/sergiomercado19)
0 commit comments