Parcourir la source

Update subnet for bridge and readme description

https
jakobsn il y a 6 ans
Parent
révision
919d3c633d
4 fichiers modifiés avec 29 ajouts et 16 suppressions
  1. +1
    -1
      .env
  2. +26
    -13
      README.md
  3. +1
    -1
      docker-compose.yml
  4. +1
    -1
      src/Dockerfile

+ 1
- 1
.env Voir le fichier

@@ -1 +1 @@
groupid=09
groupid=19

+ 26
- 13
README.md Voir le fichier

@@ -6,8 +6,9 @@ Web Server image: https://github.com/tiangolo/uwsgi-nginx-docker
webpy framework: http://webpy.org/


### Prerequisites:
docker https://www.docker.com/
## Prerequisites:

Docker https://www.docker.com/

On linux docker is started with

@@ -17,28 +18,37 @@ To run docker-compose without sudo the user must be added to the usergroup:

https://docs.docker.com/install/linux/linux-postinstall/

### Build & Run
## Run

$ docker-compose up

### Build / Rebuild

$ docker-compose up --build
Upon changes in the code the docker image must be built again for the changes to take effect. Some changes might not get reflected even on build, which is when the --force-recreate attribute can be used.

### Prune/Recreate
If you need a fresh rebuild in case of startup issues use this command (WARNING this will remove all your docker images)
$ docker-compose up --build --force-recreate

### Prune / Recreate
If you need a completely fresh rebuild (WARNING this will remove all your docker images). This will reset the images including the database which is not necessary affected by only rebuilding the images

$ docker system prune -a

$ docker-compose up --build
$ docker-compose up

# Deploy locally

Prerequisites:
Running the application outside of containers might be useful for development because the images does not need to be rebuilt for every change in the code.

## Prerequisites:

mysql

python3
python 3.6.8 or higher

src/app/requirements.txt

### Run Datatbase:
## Run Datatbase:

Launch mysql at default port (3306)

$ systemctl start mysqld
@@ -57,12 +67,15 @@ Insert mysql queries

Then populate databse by posting mysql/sql/init.sql into mysql

Edit src/app/models/database.py to point at local server


## Run app

###Run app
Edit src/app/models/database.py to point at local database server

$ cd src/app/

$ python3 src/app/main.py

# Config

The ip and ports for the web server and database is set with the .env file using the groupid variable.

+ 1
- 1
docker-compose.yml Voir le fichier

@@ -31,5 +31,5 @@ networks:
driver: bridge
ipam:
config:
- subnet: 10.${groupid}.0.0/16
- subnet: 10.${groupid}.0.0/18

+ 1
- 1
src/Dockerfile Voir le fichier

@@ -26,4 +26,4 @@ ENTRYPOINT ["/entrypoint.sh"]
RUN chmod +x ./wait-for-it.sh

# Hold the webserver from launching until the database is ready with 50s timeout
CMD ["./wait-for-it.sh", "-t", "50", "-h", "10.5.0.5", "db:3306", "--", "/start.sh"]
CMD ["./wait-for-it.sh", "-t", "50", "-h", "10.${groupid}.0.5", "db:3306", "--", "/start.sh"]

Chargement…
Annuler
Enregistrer