diff --git a/Dockerfile b/Dockerfile index 83378b62..25f0abce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN javac -version # install ant RUN apt update RUN apt -y install ant -RUN ant -version +# RUN ant -version # Causes issues with docker build # install antlr WORKDIR /usr/local/lib diff --git a/config/docker-compose.yml b/config/docker-compose.yml index c46ffd3c..8287ef90 100644 --- a/config/docker-compose.yml +++ b/config/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.7" services: db: - image: "mysql:5.7" + image: "mariadb:10.4" # Equivalent to mysql:5.7 and works on M1 Macs restart: always environment: MYSQL_ROOT_PASSWORD: root diff --git a/doc/docker.md b/doc/docker.md index 07007e22..009e114f 100644 --- a/doc/docker.md +++ b/doc/docker.md @@ -5,19 +5,27 @@ This guide will list the steps required to setup the application using Docker. ### Prerequisites -Please ensure that you have downloaded Docker in your local machine. When you open the Docker web application, the application should be displaying a green icon on the bottom left with the hover text, "Running". +Please ensure that you have downloaded Docker in your local machine. Docker can be installed from https://www.docker.com/products/docker-desktop/. When you open the Docker web application, the application should be displaying a green icon on the bottom left with the hover text, "Running". ### Set-up commands 1. Clone SSID's source code onto your computer
git clone https://github.com/WING-NUS/SSID.git
-2. Copy config/database.docker.yml to config/database.yml -3. Open a terminal and under the application root directory, run the below command: +2. Copy all the contents from config/database.docker.yml to replace all the contents of config/database.yml. +3. From here on, if any of the commands fail, try adding sudo in front of the commands (for Mac/Linux systems). For Windows systems, try running the commands in an administrator command prompt. +4. Open a terminal and under the application root directory, run the command below:
docker build .
-4. Next run the below commands: +5. Next run the below commands:
cd config/
    docker-compose run web bundle install
    docker-compose run web rails db:setup
    docker-compose build 
    docker-compose up
-5. Go to 127.0.0.1:3000 in the browser to see the login interface -6. Login with username `admin` and password `$$SSIDPassword$$` \ No newline at end of file +6. Go to 127.0.0.1:3000 in the browser to see the login interface +7. Login with username `ssidadmin123@example.com` and password `SSIDPassword123!` + +### Shutting down the application +1. To shut down the application, press Ctrl+C in the terminal where the application is running. + +### Turning on the application +1. To turn on the application, run the command below: +
docker-compose up
\ No newline at end of file