Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfile and related Document file #44

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use an official Node.js runtime as a parent image
FROM node:latest

# Set the working directory in the container
WORKDIR /app

# Copy package.json (and package-lock.json if available) into the container
COPY package*.json ./

# Install any dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Make port 8080 available to the world outside this container
EXPOSE 8080

# Define environment variable (replace with actual key or use Docker's -e flag)
ENV GOOGLE_API_KEY="Your_Key"

# Run the application
CMD ["npm", "start"]
74 changes: 74 additions & 0 deletions docker-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Using "Thala For Reason" with Docker

## Introduction

"Thala For Reason" is a Node.js-based web application. This guide provides instructions on how to run it using Docker, which simplifies setup and ensures consistency across different environments.

## Prerequisites

- Docker installed on your machine (Linux, Windows, or macOS).
- A Google API key.

## Installing Docker

### Linux

1. Update your package index:
```
sudo apt-get update
```

2. Install Docker:
```
sudo apt-get install docker-ce docker-ce-cli containerd.io
```

3. Verify the Docker installation:
```
sudo docker run hello-world
```

### Windows

1. Download Docker Desktop from [Docker Hub](https://hub.docker.com/).
2. Run the installer and follow the instructions.
3. Open Docker Desktop to complete the installation.

### macOS

1. Download Docker Desktop from [Docker Hub](https://hub.docker.com/).
2. Double-click the DMG file and drag the Docker icon to the Applications folder.
3. Open Docker from the Applications folder.

## Creating a Google API Key

Go to the [Google API key](https://makersuite.google.com/) here and generate your keys.

## Running the Application with Docker

1. Clone the repository:
```
git clone https://github.com/your-username/thala-for-reason.git
```

2. Navigate to the project directory:
```
cd thala-for-reason
```

3. Build the Docker image:
```
docker build -t thala-for-reason .
```

4. Run the Docker container, replacing `your_google_api_key` with your actual Google API key:
```
docker run -itd -p 80:8080 -e GOOGLE_API_KEY=your_google_api_key thala-for-reason
```

5. Access the application at `http://localhost:80`.

## Notes

- It's important to keep your Google API key secure. Do not hardcode it in your Dockerfile or source code.
- For detailed Docker installation instructions, refer to the official Docker documentation.