Skip to content

Commit

Permalink
build: fix docker image build (#8281)
Browse files Browse the repository at this point in the history
* We need taxonomy txt files in images as we build sto from them
* We also need to have BUILD_CACHE_REPO set on the deployment to use cache
* Use a volume for local build cache.
  • Loading branch information
alexgarel committed Apr 4, 2023
1 parent f771fa7 commit ceb524b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ packager-codes/*.csv
packager-codes/*.tsv
packager-codes/*.py
packager-codes/*.json
taxonomies*/**/*.txt
taxonomies*/**/*.sto
3 changes: 3 additions & 0 deletions .github/workflows/container-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
echo "INFLUXDB_HOST=${{ env.INFLUXDB_HOST }}" >> .env
echo "LOG_LEVEL_ROOT=ERROR" >> .env
echo "LOG_LEVEL_MONGODB=ERROR" >> .env
echo "BUILD_CACHE_REPO=openfoodfacts/openfoodfacts-build-cache" >> .env
# Override domain name in nginx.conf
sed -i.bak "s/productopener.localhost/${{ env.PRODUCT_OPENER_DOMAIN }}/g" ./conf/nginx.conf
Expand Down Expand Up @@ -180,6 +181,7 @@ jobs:
proxy_host: ${{ env.SSH_PROXY_HOST }}
proxy_username: ${{ env.SSH_USERNAME }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
command_timeout: 25m
script_stop: false
script: |
cd ${{ matrix.env }} && \
Expand All @@ -194,6 +196,7 @@ jobs:
proxy_host: ${{ env.SSH_PROXY_HOST }}
proxy_username: ${{ env.SSH_USERNAME }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
command_timeout: 15m
script_stop: false
script: |
cd ${{ matrix.env }} && \
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ x-backend-conf: &backend-conf
- products:/mnt/podata/products # .sto
- product_images:/opt/product-opener/html/images/products # .jpg
- orgs:/mnt/podata/orgs # .sto
# build-cache
- build_cache:/mnt/podata/build-cache

# all the rest
- podata:/mnt/podata


# Logs
- ./logs/apache2:/var/log/apache2
- ./logs/apache2:/mnt/podata/logs
Expand Down
1 change: 1 addition & 0 deletions docker/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ volumes:
podata: # we also need to share it because users_emails and orgs... are not separated yet
name: ${PO_COMMON_PREFIX:-}po_podata
dbdata:
build_cache:

networks:
# this is a specific network to enable pro platform to join the postgres db
Expand Down
2 changes: 2 additions & 0 deletions docker/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ volumes:
external: true
podata:
external: true
# not external, for wiping it will avoid keeping too much cached data
build_cache:

networks:
webnet:
Expand Down

0 comments on commit ceb524b

Please sign in to comment.