Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Use a Node.js base image
FROM node:20

# Install Ionic CLI globally
RUN npm install -g @ionic/cli

# Install Capacitor globally
RUN npm install -g @capacitor/cli

# Set the working directory in the container
WORKDIR /app

# Install Capacitor core (assuming it's part of your project dependencies)
RUN npm install @capacitor/core

# Install development dependencies (assuming Capacitor CLI is a dev dependency)
RUN npm install @capacitor/cli --save-dev

# Copy package.json
COPY package.json .

# Install dependencies
RUN npm install --legacy-peer-deps

# Copy the rest of the application code
COPY . .

# Create an empty environment.ts file
RUN touch src/environments/environment.ts

# Expose the port
EXPOSE 8100

# Command to run the Ionic serve
CMD ["ionic", "serve", "--host", "0.0.0.0"]

53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,56 @@ For deploying your application, you need an Environment file, Server.js, and a p
console.log(`Server is running on port ${port}`);
});
```


PROJECT SETUP WITH DOCKER
---------------------
Please follow the steps below to run the application using Docker:
* Clone the repository from GitHub using the following command:
```bash
git clone https://github.com/ELEVATE-Prjoect/mentoring-mobile-app.git
```
* Checkout to the latest branch, which is currently release-2.5.0.
* Navigate back from the mentoring-mobile-app folder and create an environment.ts file. Copy and paste the environment variables provided below into this file:
```bash
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
production: true,
name: 'debug environment',
staging: false,
dev: false,
baseUrl: 'http://localhost:3569', //backend node application url
sqliteDBName: 'mentoring.db',
deepLinkUrl: 'https://mentored.shikshalokam.org',
privacyPolicyUrl:'https://shikshalokam.org/mentoring/privacy-policy',
termsOfServiceUrl:'https://shikshalokam.org/mentoring/term-of-use'
};


/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
```
* Navigate to the mentoring-mobile-app directory, Open the docker-compose.yml file and within the docker-compose.yml file, locate the volumes section.
* In the docker-compose.yml file, replace <exact-path> with the exact file path of the environment.ts file in your system under the volumes section
```bash
volumes:
- <exact-path>/environment.ts:/app/src/environments/environment.ts
```
* Run Docker using the following command:
```bash
cd mentoring-mobile-app
docker-compose -f docker-compose.yml up
```
* To stop Docker, use the following command:
```bash
docker-compose -f docker-compose.yml down
```
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'
services:
portal:
build:
context: '.'
dockerfile: Dockerfile
container_name: portal
ports:
- '8100:8100'
volumes:
- /home/lenovo/workspace/frontend/environment.ts:/app/src/environments/environment.ts
command: >
/bin/bash -c "ionic build --prod && ionic serve --host 0.0.0.0"
networks:
- elevate_net

networks:
elevate_net:
external: false