Last active
February 17, 2023 06:13
-
-
Save tderick/a65315f6b14ebc39571531272e7ddbf9 to your computer and use it in GitHub Desktop.
Docker-compose file for Odoo with SSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#odoo server | |
upstream odoo { | |
server odoo:8069; | |
} | |
upstream odoochat { | |
server odoo:8072; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen [::]:80; | |
listen 80; | |
client_max_body_size 200M; | |
server_name erp.ysda2014.org; | |
proxy_read_timeout 720s; | |
proxy_connect_timeout 720s; | |
proxy_send_timeout 720s; | |
# Add Headers for odoo proxy mode | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Real-IP $remote_addr; | |
# log | |
access_log /var/log/nginx/odoo.access.log; | |
error_log /var/log/nginx/odoo.error.log; | |
# Redirect websocket requests to odoo gevent port | |
location /websocket { | |
proxy_pass http://odoochat; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
# Redirect requests to odoo backend server | |
location / { | |
proxy_redirect off; | |
proxy_pass http://odoo; | |
} | |
# Cache static files | |
location ~* /web/static/ { | |
proxy_cache_valid 200 90m; | |
proxy_buffering on; | |
expires 864000; | |
proxy_pass http://odoo; | |
} | |
# common gzip | |
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript; | |
gzip on; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.9' | |
services: | |
odoo: | |
container_name: odoo | |
image: odoo:16.0 | |
volumes: | |
- ./extra-addons:/mnt/extra-addons | |
- ./etc/odoo:/etc/odoo | |
- odoo-web-data:/var/lib/odoo | |
depends_on: | |
- postgres | |
postgres: | |
image: postgres:15 | |
environment: | |
- POSTGRES_DB=postgres | |
- POSTGRES_PASSWORD=password | |
- POSTGRES_USER=odoo | |
- PGDATA=/var/lib/postgresql/data/pgdata | |
volumes: | |
- odoo-db-data:/var/lib/postgresql/data/pgdata | |
nginx: | |
image: nginx:latest | |
restart: unless-stopped | |
environment: | |
- VIRTUAL_HOST=odoo.temfack.com | |
- LETSENCRYPT_HOST=odoo.temfack.com | |
- LETSENCRYPT_EMAIL=temfack@gmail.com | |
volumes: | |
- ./nginx/conf:/etc/nginx/conf.d | |
depends_on: | |
- odoo | |
volumes: | |
odoo-web-data: | |
odoo-db-data: | |
#Use this configuration in production with nginx-proxy container | |
networks: | |
default: | |
external: true | |
name: nginx-proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
addons_path = /mnt/extra-addons, | |
admin_passwd = admin_password | |
db_host = postgres | |
db_user = odoo | |
db_password = password | |
proxy_mode = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment