Skip to content

Commit

Permalink
Merge pull request #9 from Cleanwalk-org-QNSCNT/dev
Browse files Browse the repository at this point in the history
Now using a trunk based development workflow so merge of dev into main
  • Loading branch information
raphaeldenni authored Mar 4, 2024
2 parents f234fdd + c3449ff commit 89ce1c7
Show file tree
Hide file tree
Showing 134 changed files with 4,434 additions and 6,969 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.vscode
.idea
.DS_Store

node_modules
npm-debug.log

.venv
*.pyc
__pycache__/

Dockerfile
.dockerignore

.git
.gitignore
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Python
.venv
venv
*.pyc
__pycache__/

Expand All @@ -26,7 +27,7 @@ pnpm-debug.log*
lerna-debug.log*

# Others
.env
*.env
/cypress/videos/
/cypress/screenshots/
*.suo
Expand Down
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Cleanwalk V2 website and webapp

Cleanwalk.org is a website to find clean walks all over France.

## Table of Contents

- **[Frontend](front/README.md)**
- **[API](api/README.md)**

## Requirements

You only need Docker to launch the app.

### Linux

- [Docker Engine installation steps](https://docs.docker.com/engine/install/debian/#install-using-the-repository)
- [Docker Desktop (DEB package)](https://desktop.docker.com/linux/main/amd64/docker-desktop-4.26.1-amd64.deb?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-linux-amd64) (optional)

### macOS

- [Apple Silicon package](https://desktop.docker.com/mac/main/arm64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-mac-arm64)
- [Intel Chip package](https://desktop.docker.com/mac/main/amd64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-mac-amd64)

### Windows

- [Windows Installer](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe)

## How to launch

Copy the `stash.env.example` file to `stash.env` and fill the required fields, same with `api/.env.example` to `api/.env`.

### Developement

To launch the app on dev environnement, use the docker compose tool at the root directory of the project.

Dev script:

```bash
./scripts/compose-dev.sh
```

Direct command to not use the dev compose file:

```bash
docker compose up -d
```

To shutdown all stack or just a specific one:

```bash
docker compose down
```

### Production

Use Portainer for easier management. To install it, launch the script named "install-portainer.sh" and to access it you can check the service on port 9000.
3 changes: 3 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URI=mysql+mysqlconnector://root:root@localhost:3306/cleanwalk_db
API_KEY=1234567890
JWT_SECRET_KEY=098765433
20 changes: 15 additions & 5 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
FROM python:3-alpine

WORKDIR /usr/src/api
RUN addgroup -S flask && adduser -S flask -G flask

COPY requirements.txt .
RUN mkdir -p /home/flask/app && chown -R flask:flask /home/flask/app

RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /home/flask/app

COPY . .
COPY requirements*.txt ./

USER flask

RUN --mount=type=cache,target=/root/.cache/pip \
pip3 install --upgrade pip && \
pip3 install -r requirements.txt

COPY --chown=flask:flask . .

EXPOSE 5000

CMD [ "python", "./app.py" ]
ENTRYPOINT [ "python" ]

CMD [ "app.py" ]
Loading

0 comments on commit 89ce1c7

Please sign in to comment.