Skip to content

Commit

Permalink
usage with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dadegrande99 committed Jan 8, 2024
1 parent 5b3eee7 commit 7186b44
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Set the base image
FROM python:3.10


# Install the necessary packages for GUI applications
RUN apt-get update && apt-get install -y \
python3-tk

# Set the working directory in the container
WORKDIR /app

Expand All @@ -11,16 +16,16 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the content of the local src directory to the working directory in the container
COPY . .
ADD . .

# Command to run on container start
CMD [ "python", "./interface.py" ]
CMD [ "python", "interface.py" ]

# Neo4j service
FROM neo4j:latest

# Set environment variables for Neo4j
ENV NEO4J_AUTH=neo4j/test
ENV NEO4J_AUTH=neo4j/testtest1

# Expose Neo4j HTTP and Bolt ports
EXPOSE 7474 7687
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ python interface.py

Docker is a platform that allows you to automate the deployment, scaling, and management of applications using containerization. In this project, we provide a Dockerfile and a docker-compose.yml file that you can use to build a Docker image of the application and run it as a Docker container.

- *There are some problems with running the interface, you should run the interface without docker*

Here are the steps to use this project with Docker:

1. **Build the Docker image**
Expand Down Expand Up @@ -161,7 +163,6 @@ Here are the steps to use this project with Docker:
This command starts all the services defined in the `docker-compose.yml` file.

Please note that you need to have Docker and Docker Compose installed on your system to use these features. You can install Docker from the [official website](https://docs.docker.com/get-docker/) and Docker Compose from the [official documentation](https://docs.docker.com/compose/install/).
```

This section provides a brief introduction to Docker and Docker Compose, and explains how to build a Docker image of the application, run it as a Docker container, and use Docker Compose to manage the application and its services.

Expand Down
2 changes: 1 addition & 1 deletion credentials-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"uri": "bolt://localhost:7687",
"db_name": "neo4j",
"user": "neo4j",
"password": "test"
"password": "testtest1"
}
}
13 changes: 9 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
version: '3'
version: "3"
services:
app:
build: .
volumes:
- .:/app
- /tmp/.X11-unix:/tmp/.X11-unix # mount the X11 socket
environment:
- DISPLAY=host.docker.internal:0
ports:
- "5000:5000"
- "5040:5000"
command: ["python", "interface.py"] # Command to run your interface.py

neo4j:
image: neo4j:latest
environment:
- NEO4J_AUTH=neo4j/test
- NEO4J_AUTH=neo4j/testtest1
ports:
- "7474:7474"
- "7687:7687"
- "7687:7687"

0 comments on commit 7186b44

Please sign in to comment.