-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9195926
commit f18ad8a
Showing
9 changed files
with
313 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM node:14 as vsf-pre | ||
|
||
WORKDIR /app | ||
|
||
COPY . / | ||
|
||
RUN apt-get install -y --no-install-recommends git \ | ||
&& yarn install \ | ||
--prefer-offline \ | ||
--frozen-lockfile \ | ||
--non-interactive \ | ||
--production=false | ||
|
||
RUN yarn build | ||
|
||
RUN rm -rf node_modules && \ | ||
NODE_ENV=development yarn install \ | ||
--prefer-offline \ | ||
--pure-lockfile \ | ||
--non-interactive \ | ||
--production=false | ||
|
||
FROM node:14 as vsf2 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=vsf-pre /app . | ||
|
||
ENV HOST 0.0.0.0 | ||
|
||
|
||
CMD [ "yarn", "start" ] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
version: "3.7" | ||
|
||
|
||
services: | ||
|
||
redis: | ||
container_name: redis | ||
image: library/redis:5.0-alpine | ||
restart: unless-stopped | ||
networks: | ||
- net1 | ||
volumes: | ||
- redis_data:/data | ||
|
||
nginx: | ||
env_file: .env | ||
image: nginx:latest | ||
container_name: nginx | ||
restart: unless-stopped | ||
depends_on: | ||
- odoo | ||
ports: | ||
- ${TEST_VSF_DOCKER_PORT}:${TEST_VSF_DOCKER_PORT} | ||
- ${TEST_ODOO_DOCKER_PORT}:${TEST_ODOO_DOCKER_PORT} | ||
volumes: | ||
- ./docker/nginx/templates:/etc/nginx/templates | ||
- web_root:/var/www/html | ||
networks: | ||
- net1 | ||
|
||
db: | ||
env_file: .env | ||
image: postgres:12 | ||
container_name: db | ||
restart: unless-stopped | ||
networks: | ||
- net1 | ||
volumes: | ||
- db_home:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_USER=odoo | ||
- POSTGRES_PASSWORD=odoo | ||
- POSTGRES_DB=v14_odoo | ||
|
||
odoo_init: | ||
env_file: .env | ||
build: | ||
context: ./docker/14.0 | ||
dockerfile: Dockerfile | ||
container_name: odoo_ini | ||
working_dir: "/mnt/extra-addons" | ||
command: > | ||
bash -c "if [ ! -d "/mnt/extra-addons/graphql_vuestorefront" ]; then git clone --branch 14.0 https://github.com/odoogap/vuestorefront.git . | ||
&& git submodule update --init --recursive | ||
&& /entrypoint.sh odoo -d v14_odoo -i base --max-cron-threads 0 --no-http --stop-after-init -i graphql_vuestorefront | ||
&& /entrypoint.sh odoo shell -d v14_odoo --max-cron-threads 0 --no-http < /start_script.py ; fi" | ||
image: odoogap | ||
restart: "no" | ||
volumes: | ||
- odoo_home:/var/lib/odoo | ||
- odoo_extra:/mnt/extra-addons | ||
- ./docker/14.0/odoo.conf:/etc/odoo/odoo.conf | ||
- ./docker/14.0/start_script.py:/start_script.py | ||
depends_on: | ||
- db | ||
networks: | ||
- net1 | ||
|
||
odoo: | ||
env_file: .env | ||
build: | ||
context: ./docker/14.0 | ||
dockerfile: Dockerfile | ||
container_name: odoo | ||
image: odoogap | ||
restart: unless-stopped | ||
volumes: | ||
- odoo_home:/var/lib/odoo | ||
- odoo_extra:/mnt/extra-addons | ||
- ./docker/14.0/odoo.conf:/etc/odoo/odoo.conf | ||
depends_on: | ||
- db | ||
networks: | ||
- net1 | ||
|
||
vsf: | ||
env_file: .env | ||
environment: | ||
BASE_URL: http://localhost:8069/ | ||
BACKEND_BASE_URL: http://odoo:8069/ | ||
REDIS_HOST: redis | ||
REDIS_PORT: 6379 | ||
container_name: vsf | ||
image: vsf2 | ||
restart: unless-stopped | ||
depends_on: | ||
- redis | ||
- odoo | ||
networks: | ||
- net1 | ||
|
||
|
||
volumes: | ||
db_home: | ||
external: false | ||
odoo_home: | ||
external: false | ||
odoo_extra: | ||
external: False | ||
web_root: | ||
external: false | ||
redis_data: | ||
external: false | ||
|
||
networks: | ||
net1: | ||
name: net1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM odoo:14.0 AS odoogap | ||
|
||
USER root | ||
|
||
COPY ./requirements.txt / | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends git \ | ||
&& python3 -m pip install --no-cache-dir -r requirements.txt \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER odoo | ||
|
||
CMD ["odoo"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[options] | ||
addons_path = /mnt/extra-addons | ||
data_dir = /var/lib/odoo | ||
; admin_passwd = admin | ||
; csv_internal_sep = , | ||
; db_maxconn = 64 | ||
db_name = v14_odoo | ||
db_user = odoo | ||
db_password = odoo | ||
db_host = db | ||
; db_template = template1 | ||
dbfilter = ^v14_odoo$ | ||
; debug_mode = False | ||
; email_from = False | ||
; limit_memory_hard = 2684354560 | ||
; limit_memory_soft = 2147483648 | ||
; limit_request = 8192 | ||
; limit_time_cpu = 60 | ||
; limit_time_real = 120 | ||
; list_db = True | ||
; log_db = False | ||
; log_handler = [':INFO'] | ||
; log_level = info | ||
; logfile = None | ||
; longpolling_port = 8072 | ||
; max_cron_threads = 2 | ||
; osv_memory_age_limit = 1.0 | ||
; osv_memory_count_limit = False | ||
; smtp_password = False | ||
; smtp_port = 25 | ||
; smtp_server = localhost | ||
; smtp_ssl = False | ||
; smtp_user = False | ||
workers = 3 | ||
; xmlrpc = True | ||
; xmlrpc_interface = | ||
; xmlrpc_port = 8069 | ||
; xmlrpcs = True | ||
; xmlrpcs_interface = | ||
; xmlrpcs_port = 8071 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
redis==4.0.2 | ||
graphene==3.0 | ||
graphql-server==3.0.0b4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/python | ||
env['ir.config_parameter'].set_param('web.base.url', 'http://localhost:8069') | ||
env['ir.config_parameter'].set_param('web.base.url.freeze', 'True') | ||
env.cr.commit() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
upstream up-vsf { | ||
least_conn; | ||
server vsf:3000; | ||
} | ||
upstream up-odoo { | ||
least_conn; | ||
server odoo:8069; | ||
} | ||
upstream up-long { | ||
least_conn; | ||
server odoo:8072; | ||
} | ||
|
||
# Vuestorefront2 Server | ||
server { | ||
listen ${TEST_VSF_DOCKER_PORT}; | ||
|
||
proxy_read_timeout 720s; | ||
proxy_connect_timeout 720s; | ||
proxy_send_timeout 720s; | ||
|
||
proxy_buffers 16 64k; | ||
proxy_buffer_size 128k; | ||
client_max_body_size 10M; | ||
|
||
# Redirect requests to vsf1 backend server | ||
location / { | ||
proxy_set_header X-Forwarded-Port ${TEST_VSF_DOCKER_PORT}; | ||
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; | ||
proxy_set_header X-Forwarded-Host $server_name:${TEST_VSF_DOCKER_PORT}; | ||
proxy_set_header X-Nginx-Proxy true; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
|
||
proxy_pass http://up-vsf; | ||
proxy_redirect off; | ||
proxy_read_timeout 240s; | ||
} | ||
|
||
# Common gzip | ||
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript; | ||
gzip on; | ||
|
||
} | ||
|
||
# Odoo Server | ||
server { | ||
listen ${TEST_ODOO_DOCKER_PORT}; | ||
|
||
proxy_read_timeout 720s; | ||
proxy_connect_timeout 720s; | ||
proxy_send_timeout 720s; | ||
|
||
proxy_buffers 16 64k; | ||
proxy_buffer_size 128k; | ||
client_max_body_size 10M; | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header X-Forwarded-Host $server_name:${TEST_ODOO_DOCKER_PORT}; | ||
proxy_set_header X-Forwarded-Port ${TEST_ODOO_DOCKER_PORT}; | ||
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; | ||
|
||
location ~* ^/([^/]+/static/|web/(css|js)/|web/image|web/content|website/image/) { | ||
proxy_cache_valid 200 60m; | ||
proxy_buffering on; | ||
expires 30d; | ||
proxy_pass http://up-odoo; | ||
} | ||
|
||
location /longpolling { | ||
proxy_pass http://up-long; | ||
} | ||
|
||
# Redirect requests to odoo backend server | ||
location / { | ||
proxy_redirect off; | ||
proxy_pass http://up-odoo; | ||
} | ||
|
||
# Common gzip | ||
gzip_types text/css text/less 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