Skip to content
Snippets Groups Projects
Verified Commit c3761454 authored by David Beniamine's avatar David Beniamine
Browse files

Docker stack

parent e1fb6fd1
No related branches found
No related tags found
No related merge requests found
COMPOSE_FILE=docker-compose.yml:ports.yml
HOST=0.0.0.0
PORT=5000
MYSQL_USER=mirador_backend
MYSQL_PASSWORD=randompassword
MYSQL_ROOT_PASSWORD=otherrandompassword
MYSQL_DATABASE=mirador_backend
ENV=dev
......@@ -2,3 +2,5 @@ venv
*.egg-info
.eggs
**/__pycache__
.env
*.sw?
File moved
File moved
# Mirador backend
## Requirements
## Install and run
### local
#### Requirements
+ virtualenv (optionnal)
+ Python >= 3.10
## Install
### Dev mode
#### Dev mode
1. Optionnal create a virtual env `virtualenv venv && . venv/bin/activate`
2. Install dependencies `pip install -e .`
3. `cp .env.sample .env` and edit `.env` file to suit your needs
4. Run `flask --debug --app Mirador_backend.app run`
### Production mode
#### Production mode
**TODO**
### Production mode
**TODO**
## Run
### Docker
### Dev mode
#### Requirements
```
cd Mirador-backend
flask --debug run
```
+ [docker](https://www.docker.com/)
+ [docker compose](https://docs.docker.com/compose/install/)
### Production mode
#### Install and run
**TODO**
```
cp .env.sample .env
# Edit .env file to suit your needs
docker-compose up
```
version: "3"
services:
flask:
build:
context: "docker/flask"
environment:
ENV:
HOST:
volumes:
- .:/app
db:
image: mariadb
environment:
MYSQL_USER:
MYSQL_PASSWORD:
MYSQL_DATABASE:
MYSQL_ROOT_PASSWORD:
volumes:
- db_data:/var/lib/mysql
volumes:
db_data:
FROM python:3.10
COPY entrypoint.sh /entrypoint
RUN mkdir /app
WORKDIR /app
ENTRYPOINT ["/entrypoint"]
#!/bin/bash
pip install -e .
exec flask --debug --app Mirador_backend.app run --host $HOST
version: "3"
services:
flask:
ports:
- $FLASK_PORT:5000
......@@ -30,7 +30,7 @@ setup(
packages=find_packages(),
install_requires=["flask", "flask-restful"],
install_requires=["flask", "flask-restful", "python-dotenv"],
setup_requires=["pytest-runner"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment