Seumi / PneumaProject

a plagiarism detection system specific to source code based on jplag
MIT License
1 stars 0 forks source link

How should I deploy this project? #2

Open Seumi opened 2 months ago

Seumi commented 2 months ago

How should I deploy this project?

dosubot[bot] commented 2 months ago

Hey @Seumi! I'm here to help you with any questions or issues you have regarding this project. Feel free to ask me anything while you wait for a human maintainer.

To deploy the PneumaProject, follow these steps:

  1. Install System Dependencies: Ensure you have the required system dependencies installed on your server. For Ubuntu, you can install them using:

    apt install enca node zip unzip
  2. Install Node.js and npm: Ensure you have Node.js (version 8.10) and npm installed on your server.

  3. Clone the repository: Clone the PneumaProject repository to your server.

  4. Install Node.js dependencies: Navigate to the project directory and run npm install to install all necessary dependencies.

  5. Configure the project: Update the server/config/index.js file with the appropriate paths and settings for your environment. Example configuration:

    module.exports = {
        jwt: {
            secret: 'pneuma0.01',
            exp: '1h'
        },
        workplace: {
            path: '/home/seumi/pneuma',
            bin: '/home/seumi/pneuma/bin.jar'
        },
        langtype: {
            java: {
                name: 'java17',
                ext: [".java", ".jav", ".JAVA", ".JAV"]
            },
            csharp: {
                name: 'c#-1.2',
                ext: [".cs", ".CS"]
            },
            ccpp: {
                name: 'c/c++',
                ext: [".cpp", ".CPP", ".cxx", ".CXX", ".c++", ".C++", ".c", ".C", ".cc", ".CC", ".h", ".H", ".hpp", ".HPP", ".hh", ".HH"]
            },
            python: {
                name: 'python3',
                ext: [".py"]
            },
            web: {
                name: 'text',
                ext: ['.html', '.htm', '.css', '.js', '.asp', '.aspx']
            },
            text: {
                name: 'text',
                ext: [".TXT", ".txt", ".ASC", ".asc", ".TEX", ".tex"]
            }
        },
        mongodb: {
            uri: 'mongodb://127.0.0.1:27017/pneuma',
            options: {}
        }
    }
  6. Set up MongoDB: Ensure MongoDB (version 3.4) is installed and running on your server. The URI in the configuration should point to your MongoDB instance.

  7. Set up production environment: Create a config/prod.env.js file with the following content to set the environment to production:

    'use strict'
    module.exports = {
      NODE_ENV: '"production"'
    }
  8. Run the server: Start the server using npm run server for the backend and npm run dev for the frontend. The frontend will be accessible at localhost:8080 [1][2][3].

To continue talking to Dosu, mention @dosu.

Seumi commented 2 months ago

@dosu could you make a dockfile to make the project as a docker image

dosubot[bot] commented 2 months ago

To create a Dockerfile for the PneumaProject, you can use the following Dockerfile:

# Use an official Node.js runtime as a parent image
FROM node:14

# Set the working directory
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install project dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Install MongoDB client
RUN apt-get update && apt-get install -y mongodb-clients

# Expose the port the app runs on
EXPOSE 3000

# Set environment variables for production
ENV NODE_ENV=production

# Command to run the server
CMD ["node", "server.js"]

This Dockerfile does the following:

  1. Uses the official Node.js 14 image as the base.
  2. Sets the working directory to /usr/src/app.
  3. Copies package.json and package-lock.json to the working directory.
  4. Installs the project dependencies using npm install.
  5. Copies the rest of the application code to the working directory.
  6. Installs the MongoDB client.
  7. Exposes port 3000, which is assumed to be the port your server runs on.
  8. Sets the NODE_ENV environment variable to production.
  9. Specifies the command to run the server using node server.js.

Make sure to adjust the port number and the command to run the server if they are different in your project [1].

To continue talking to Dosu, mention @dosu.

sweep-ai[bot] commented 2 months ago
Sweeping

0%

Actions

Hi there, thanks for your question about deploying the project. Unfortunately, this issue is a bit too broad and open-ended for our AI assistant Sweep to handle at the moment. Deployment often requires accessing cloud provider consoles, setting up infrastructure, and running command line operations, which are outside of Sweep's current capabilities.

To make this a better issue for Sweep, could you please provide more specifics on what you've already tried in terms of deployment, and clarify if there are any code changes needed to support deployment? Sweep is great at making targeted code changes, but needs clear direction on what needs to be modified.

Please feel free to rephrase the issue with more details and we'll take another look! Let me know if you have any other questions.

Report a bug.


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.