1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-17 10:22:36 +00:00

Various docker fixes:

- Dont use a named volume to store node_modules in the dev
env to always get a fresh image based node_modules
- Fix the PUBLIC_WEB_FRONTEND_URL mis config in the docker-compose file
- Update docs for publicly exposing baserow
- Fix bad link in docs
This commit is contained in:
Nigel Gott 2021-07-29 10:10:42 +01:00
parent c51efc7490
commit af96c3d730
5 changed files with 23 additions and 23 deletions

View file

@ -13,8 +13,8 @@ Gitter https://gitter.im/bramw-baserow/community.
> redis, db and mjml containers. Additionally, 1.4.2 only exposes the backend, > redis, db and mjml containers. Additionally, 1.4.2 only exposes the backend,
> web-frontend and media containers on localhost and not on 0.0.0.0. If you were > web-frontend and media containers on localhost and not on 0.0.0.0. If you were
> previously relying on `docker-compose.yml` publicly exposing Baserow then please > previously relying on `docker-compose.yml` publicly exposing Baserow then please
> follow the [Make Baserow publicly accessible](./docs/guides/running-baserow-locally.md) > follow the [Make Baserow publicly accessible](./docs/guides/baserow-docker-how-to.md)
> guide. > section in the docker how to guide.
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/bram2w/baserow/tree/master) [![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/bram2w/baserow/tree/master)
*Beta* *Beta*

3
dev.sh
View file

@ -211,7 +211,8 @@ echo "./dev.sh running docker-compose commands:
" "
if [ "$down" = true ] ; then if [ "$down" = true ] ; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml down # Remove the containers and remove the anonymous volumes for cleanliness sake.
docker-compose -f docker-compose.yml -f docker-compose.dev.yml rm -s -v -f
fi fi
if [ "$kill" = true ] ; then if [ "$kill" = true ] ; then

View file

@ -19,7 +19,6 @@ services:
volumes: volumes:
- ./backend:/baserow/backend - ./backend:/baserow/backend
- ./premium/backend/:/baserow/backend/plugins/premium - ./premium/backend/:/baserow/backend/plugins/premium
- backend-dev-plugins:/baserow/backend/plugins
# Open stdin and tty so when attaching key input works as expected. # Open stdin and tty so when attaching key input works as expected.
stdin_open: true stdin_open: true
tty: true tty: true
@ -38,7 +37,6 @@ services:
volumes: volumes:
- ./backend:/baserow/backend - ./backend:/baserow/backend
- ./premium/backend/:/baserow/backend/plugins/premium - ./premium/backend/:/baserow/backend/plugins/premium
- backend-dev-plugins:/baserow/backend/plugins
# Open stdin and tty so when attaching key input works as expected. # Open stdin and tty so when attaching key input works as expected.
stdin_open: true stdin_open: true
tty: true tty: true
@ -57,7 +55,6 @@ services:
volumes: volumes:
- ./backend:/baserow/backend - ./backend:/baserow/backend
- ./premium/backend/:/baserow/backend/plugins/premium - ./premium/backend/:/baserow/backend/plugins/premium
- backend-dev-plugins:/baserow/backend/plugins
# Open stdin and tty so when attaching key input works as expected. # Open stdin and tty so when attaching key input works as expected.
stdin_open: true stdin_open: true
tty: true tty: true
@ -76,7 +73,6 @@ services:
volumes: volumes:
- ./backend:/baserow/backend - ./backend:/baserow/backend
- ./premium/backend/:/baserow/backend/plugins/premium - ./premium/backend/:/baserow/backend/plugins/premium
- backend-dev-plugins:/baserow/backend/plugins
# Open stdin and tty so when attaching key input works as expected. # Open stdin and tty so when attaching key input works as expected.
stdin_open: true stdin_open: true
tty: true tty: true
@ -94,19 +90,10 @@ services:
volumes: volumes:
- ./web-frontend:/baserow/web-frontend - ./web-frontend:/baserow/web-frontend
- ./premium/web-frontend/:/baserow/web-frontend/plugins/premium - ./premium/web-frontend/:/baserow/web-frontend/plugins/premium
- web-frontend-dev-node-modules:/baserow/web-frontend/node_modules
- web-frontend-dev-plugins:/baserow/web-frontend/plugins
# Open stdin and tty so when attaching key input works as expected. # Open stdin and tty so when attaching key input works as expected.
stdin_open: true stdin_open: true
tty: true tty: true
media-volume-fixer: media-volume-fixer:
command: chown ${UID:-1000}:${GID:-1000} -R /baserow/media command: chown ${UID:-1000}:${GID:-1000} -R /baserow/media
# Give names to the volumes declared in the docker dev images so we dont end up with hundreds
# of anonymous volumes.
volumes:
web-frontend-dev-node-modules:
web-frontend-dev-plugins:
backend-dev-plugins:

View file

@ -35,7 +35,7 @@ services:
image: baserow_backend:latest image: baserow_backend:latest
environment: environment:
- PUBLIC_BACKEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:8000} - PUBLIC_BACKEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:8000}
- PUBLIC_WEB_FRONTEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:3000} - PUBLIC_WEB_FRONTEND_URL=${PUBLIC_WEB_FRONTEND_URL:-http://localhost:3000}
- MIGRATE_ON_STARTUP=${MIGRATE_ON_STARTUP:-true} - MIGRATE_ON_STARTUP=${MIGRATE_ON_STARTUP:-true}
- SYNC_TEMPLATES_ON_STARTUP=${SYNC_TEMPLATES_ON_STARTUP:-true} - SYNC_TEMPLATES_ON_STARTUP=${SYNC_TEMPLATES_ON_STARTUP:-true}
- DATABASE_USER=${DATABASE_USER:-baserow} - DATABASE_USER=${DATABASE_USER:-baserow}
@ -139,7 +139,7 @@ services:
image: baserow_web-frontend:latest image: baserow_web-frontend:latest
environment: environment:
- PUBLIC_BACKEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:8000} - PUBLIC_BACKEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:8000}
- PUBLIC_WEB_FRONTEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:3000} - PUBLIC_WEB_FRONTEND_URL=${PUBLIC_WEB_FRONTEND_URL:-http://localhost:3000}
- ADDITIONAL_MODULES - ADDITIONAL_MODULES
ports: ports:
- "${HOST_PUBLISH_IP:-127.0.0.1}:${WEB_FRONTEND_PORT:-3000}:3000" - "${HOST_PUBLISH_IP:-127.0.0.1}:${WEB_FRONTEND_PORT:-3000}:3000"

View file

@ -66,15 +66,27 @@ Baserow on your network.
2. `PUBLIC_BACKEND_URL={REPLACE_WITH_YOUR_DOMAIN_NAME_OR_HOST_IP}:8000` - This will 2. `PUBLIC_BACKEND_URL={REPLACE_WITH_YOUR_DOMAIN_NAME_OR_HOST_IP}:8000` - This will
ensure that Baserow clients will be able to successfully connect to the backend, ensure that Baserow clients will be able to successfully connect to the backend,
if you can visit Baserow at port `3000` but you are getting API errors please ensure if you can visit Baserow at port `3000` but you are getting API errors please ensure
this variable is set correctly. this variable is set correctly. If an IP address this must start with `http://` or
`https://`.
3. `PUBLIC_WEB_FRONTEND_URL={REPLACE_WITH_YOUR_DOMAIN_NAME_OR_HOST_IP}:3000` - The same 3. `PUBLIC_WEB_FRONTEND_URL={REPLACE_WITH_YOUR_DOMAIN_NAME_OR_HOST_IP}:3000` - The same
variable as above but the URL for the web-frontend container instead. variable as above but the URL for the web-frontend container instead.
For example you could run the command below after replacing `REPLACE_ME` with the Then you will need to go to `src/baserow/config/settings/base.py:16` and modify the
IP address or domain name of the server where Baserow is running: `ALLOWED_HOSTS` variable to include the hostname or IP address of the server that
Baserow will be running on (the hostname/ip you will be typing into the
browser to access the site). For example adding a local network's IP would look like:
```python
ALLOWED_HOSTS = ["localhost", "192.168.0.194"]
```
One way of setting the 3 environment variables is below. Please replease `REPLACE_ME`
with the IP address or domain name of the server where Baserow is running. Ensure that
you prepend IP addresses with `http://` as shown in the second command below.
```bash ```bash
$ HOST_PUBLISH_IP=0.0.0.0 PUBLIC_BACKEND_URL=REPLACE_ME:8000 PUBLIC_WEB_FRONTEND_URL=REPLACE_ME:3000 docker-compose up $ HOST_PUBLISH_IP=0.0.0.0 PUBLIC_BACKEND_URL=REPLACE_ME:8000 PUBLIC_WEB_FRONTEND_URL=REPLACE_ME:3000 docker-compose up --build
# For example running Baserow on a local network would look something like:
$ HOST_PUBLISH_IP=0.0.0.0 PUBLIC_BACKEND_URL=http://192.168.0.194:8000 PUBLIC_WEB_FRONTEND_URL=http://192.168.0.194:3000 docker-compose up --build
``` ```
### Configure an external email server ### Configure an external email server