1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-11 07:51:20 +00:00

Merge branch '441-small-fixes-to-make-docker-compose-files-easier-to-work-with' into 'develop'

Small compose changes + ensure docker setup works on windows

Closes 

See merge request 
This commit is contained in:
Nigel Gott 2021-05-06 00:27:33 +00:00
commit e1d741637a
4 changed files with 40 additions and 3 deletions

9
.gitattributes vendored Normal file
View file

@ -0,0 +1,9 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# So the bash scripts work when run inside the baserow docker images
*.sh text eol=lf
# Prettier does not allow windows file endings by default
*.js text eol=lf
*.vue text eol=lf
*.scss text eol=lf

View file

@ -1,4 +1,4 @@
version: "3.7"
version: "3"
services:
@ -15,16 +15,26 @@ services:
volumes:
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/backend/plugins/premium
- backend-dev-plugins:/baserow/backend/plugins
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
celery:
image: baserow_backend_dev:latest
build:
context: .
dockerfile: ./backend/docker/Dockerfile.dev
args:
# We allow configuring the UID/GID here so you can run as the dev's actual user
# reducing the chance the containers screw up the bind mounted folders.
UID: "${UID:-}"
GID: "${GID:-}"
command: celery-dev
volumes:
- ./backend:/baserow/backend
- ./premium/backend/:/baserow/backend/plugins/premium
- backend-dev-plugins:/baserow/backend/plugins
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
@ -42,6 +52,8 @@ services:
volumes:
- ./web-frontend:/baserow/web-frontend
- ./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.
stdin_open: true
@ -49,3 +61,10 @@ services:
media-volume-fixer:
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

@ -1,4 +1,4 @@
version: "3.7"
version: "3"
services:
db:
@ -40,6 +40,8 @@ services:
context: .
image: baserow_backend:latest
environment:
- PUBLIC_BACKEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:8000}
- PUBLIC_WEB_FRONTEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:3000}
- MIGRATE_ON_STARTUP=${MIGRATE_ON_STARTUP:-true}
- SYNC_TEMPLATES_ON_STARTUP=${SYNC_TEMPLATES_ON_STARTUP:-true}
- DATABASE_USER=${DATABASE_USER:-baserow}
@ -62,6 +64,9 @@ services:
celery:
container_name: celery
image: baserow_backend:latest
build:
dockerfile: ./backend/Dockerfile
context: .
command: celery
depends_on:
- backend
@ -77,6 +82,8 @@ services:
dockerfile: ./web-frontend/Dockerfile
image: baserow_web-frontend:latest
environment:
- PUBLIC_BACKEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:8000}
- PUBLIC_WEB_FRONTEND_URL=${PUBLIC_BACKEND_URL:-http://localhost:3000}
- ADDITIONAL_MODULES
ports:
- "${WEB_FRONTEND_PORT:-3000}:3000"

View file

@ -40,8 +40,10 @@ ADD --chown=$UID:$GID ./premium/web-frontend /baserow/web-frontend/plugins/premi
RUN dos2unix /baserow/web-frontend/docker/docker-entrypoint.sh && \
chmod a+x /baserow/web-frontend/docker/docker-entrypoint.sh
# Ensure we don't overwrite the built node_modules with an empty mount from a fresh checkout.
VOLUME ["/baserow/web-frontend/node_modules"]
# Ensure we don't pollute the devs actual repo when mounting in files by
# putting these two folders into anonymous docker volumes.
# putting the plugins into an anonymous docker volumes.
VOLUME ["/baserow/web-frontend/plugins"]
# tini installed above protects us from zombie processes and ensures the default signal
# handlers work, see https://github.com/krallin/tini.