commit 695abe054be3dca5b5e487c5475b5ff5de320cc8 Author: Elena Arenskötter Date: Thu Nov 9 18:44:50 2023 +0100 first commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..def402e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:alpine + +WORKDIR /app + +COPY ./nginx.conf /etc/nginx/nginx.conf diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ebf33b --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# Kassenzettel + +Kassenzettel is a web application for managing recipes and shopping lists. It consists of a Django server for the backend and a React frontend for the user interface. + +## Installation + +1. Clone the repository: + + ``` + git clone https://github.com/username/kassenzettel.git + ``` + +2. Install the Python dependencies: + + ``` + cd receipeServer + pip install -r requirements.txt + ``` + +3. Install the Node.js dependencies: + + ``` + cd reactFrontend + yarn install + ``` + +## Usage + +1. Start the Django server: + + ``` + cd receipeServer + python manage.py qcluster + python manage.py runserver + ``` + +2. Start the React frontend: + + ``` + cd reactFrontend + yarn start + ``` + +3. Open the application in a web browser: + + ``` + http://localhost:3000/ + ``` + +## Updating + +To update the frontend packages, run: + +``` +cd ../reactFrontend +yarn upgrade +``` + +## License + +This project is licensed under the [MIT License](LICENSE). \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d924b82 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,35 @@ +version: '3.1' + +services: + db: + image: postgres:alpine + container_name: kassenzettel-postgres + restart: always + ports: + - 5432:5432 + volumes: + - ./db:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: example + POSTGRES_USER: postgres + POSTGRES_DB: kassenzettel + POSTGRES_INITDB_ARGS: "--encoding='UTF8'" + + redis: + image: redis:alpine + container_name: kassenzettel-redis + restart: always + ports: + - 6379:6379 + + web: + build: + context: . + dockerfile: Dockerfile + container_name: nginx + restart: always + ports: + - 8080:8080 + volumes: + - ./receipeServer/static/:/app/static + \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..944b82c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,18 @@ +events {} +http { + include mime.types; + sendfile on; + + server { + listen 8080; + + resolver 127.0.0.1; + autoindex off; + + server_name _; + server_tokens off; + + root /app/static; + gzip_static on; + } +}