Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
version: '3.8'
services:
recipes-db:
container_name: recipes-db
image: postgres:11-alpine
restart: "no"
hostname: recipes-db
env_file: .env
security_opt:
- no-new-privileges:true
mem_limit: 85m
mem_reservation: 85m
ports:
- 5434:5432/tcp
volumes:
- /volume1/docker/recipes/db:/var/lib/postgresql/data:rw
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
environment:
- TZ=your/timezone
networks:
- recipes_network
recipes-web:
container_name: recipes-web
image: vabene1111/recipes:latest
restart: "no"
hostname: recipes-web
env_file: .env
security_opt:
- no-new-privileges:true
mem_limit: 85m
mem_reservation: 85m
depends_on:
- recipes-db
volumes:
- /volume1/docker/recipes/nginx/conf.d:/opt/recipes/nginx/conf.d
- /volume1/docker/recipes/staticfiles:/opt/recipes/staticfiles
- /volume1/docker/recipes/mediafiles:/opt/recipes/mediafiles
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
environment:
- TZ=your/timezone
networks:
- recipes_network
recipes-nginx:
container_name: recipes-nginx
image: nginx:mainline-alpine
restart: "no"
hostname: recipes-nginx
env_file: .env
security_opt:
- no-new-privileges:true
mem_limit: 85m
mem_reservation: 85m
depends_on:
- recipes-web
ports:
- 3080:80
volumes:
- /volume1:/etc/nginx/conf.d:ro
- /volume1/docker/recipes/staticfiles:/static
- /volume1/docker/recipes/mediafiles:/media
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
environment:
- TZ=your/timezone
networks:
- recipes_network
networks:
recipes_network:
name: recipes_network
server {
listen 80;
server_name localhost;
client_max_body_size 128M;
# serve media files
location /media/ {
alias /media/;
}
# pass requests for dynamic content to gunicorn
location / {
proxy_set_header Host $http_host;
proxy_pass http://recipes-web:8080;
}
}
cd /volume1/docker/recipes
docker-compose -p "recipes" up -d
Heya,Hi,
I have reinstalled the containers, but this time I used docker-compose. And everything is working fine on my end.
I can add pictures and they shows on the recipe and also saved in the mediafiles folder. I also tried to import from an URL and from there the pictures has saved into the mediafiles folder.
About the folder permissions.
I see the following permissions with my folders: (Group:Owner)
db folder = Users:70
mediafiles = Root:Root
staticfiles = Root:Root
You can change the permissions using terminal.
If you want to try the docker-compose versions here is my docker-compose file, alter it to your needs:
YAML:version: '3.8' services: recipes-db: container_name: recipes-db image: postgres:11-alpine restart: "no" hostname: recipes-db env_file: .env security_opt: - no-new-privileges:true mem_limit: 85m mem_reservation: 85m ports: - 5434:5432/tcp volumes: - /volume1/docker/recipes/db:/var/lib/postgresql/data:rw - /etc/localtime:/etc/localtime:ro - /etc/TZ:/etc/timezone:ro environment: - TZ=your/timezone networks: - recipes_network recipes-web: container_name: recipes-web image: vabene1111/recipes:latest restart: "no" hostname: recipes-web env_file: .env security_opt: - no-new-privileges:true mem_limit: 85m mem_reservation: 85m depends_on: - recipes-db volumes: - /volume1/docker/recipes/nginx/conf.d:/opt/recipes/nginx/conf.d - /volume1/docker/recipes/staticfiles:/opt/recipes/staticfiles - /volume1/docker/recipes/mediafiles:/opt/recipes/mediafiles - /etc/localtime:/etc/localtime:ro - /etc/TZ:/etc/timezone:ro environment: - TZ=your/timezone networks: - recipes_network recipes-nginx: container_name: recipes-nginx image: nginx:mainline-alpine restart: "no" hostname: recipes-nginx env_file: .env security_opt: - no-new-privileges:true mem_limit: 85m mem_reservation: 85m depends_on: - recipes-web ports: - 3080:80 volumes: - /volume1:/etc/nginx/conf.d:ro - /volume1/docker/recipes/staticfiles:/static - /volume1/docker/recipes/mediafiles:/media - /etc/localtime:/etc/localtime:ro - /etc/TZ:/etc/timezone:ro environment: - TZ=your/timezone networks: - recipes_network networks: recipes_network: name: recipes_network
Place the following file Recipes.conf in the /docker/recipes/nginx/conf.d folder
Code:server { listen 80; server_name localhost; client_max_body_size 128M; # serve media files location /media/ { alias /media/; } # pass requests for dynamic content to gunicorn location / { proxy_set_header Host $http_host; proxy_pass http://recipes-web:8080; } }
Copy the env.template file to your docker folder and save it as .env and alter to you needs
env.template
Run the docker-compose after you finished changing everything to your needs
Code:cd /volume1/docker/recipes docker-compose -p "recipes" up -d
Yes it still works! Not using it much so the containers are most of time off, but yes still working.does your setup still work?
We use essential cookies to make this site work, and optional cookies to enhance your experience.