From 88fff9e48b2c1425028d1151c04076b31b76ac61 Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Fri, 15 Feb 2019 23:09:04 +0100 Subject: [PATCH] :green_heart: Fix build and docker-compose run --- docker-compose.yml | 12 ++++++------ docker/Dockerfile | 3 +++ manage.sh | 8 ++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0e5f33e50..e03a3f8d2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ volumes: uxbox_db: services: - uxbox_db: + db: image: postgres:latest restart: always ports: @@ -18,10 +18,10 @@ services: volumes: - uxbox_db:/var/lib/postgresql/data - uxbox_backend: + backend: build: ./backend #image: monogramm/uxbox:backend - restart: always + #restart: always depends_on: - uxbox_db ports: @@ -47,13 +47,13 @@ services: - "UXBOX_DB_USER=uxbox" - "UXBOX_DB_PASSWORD=youshouldoverwritethiswithsomethingelse" - "UXBOX_DB_NAME=uxbox" - - "UXBOX_DB_HOST=uxbox_db" + - "UXBOX_DB_HOST=db" - "UXBOX_DB_PORT=5432" - uxbox_frontend: + frontend: build: ./frontend #image: monogramm/uxbox:frontend - restart: always + #restart: always depends_on: - uxbox_backend ports: diff --git a/docker/Dockerfile b/docker/Dockerfile index f9e04cfdb..a770d235d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -71,6 +71,9 @@ EXPOSE 3449 EXPOSE 6060 EXPOSE 9090 +RUN useradd -m -g users -s /bin/bash uxbox; \ + passwd uxbox -d; \ + echo "uxbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ USER uxbox COPY files/lein /home/uxbox/.local/bin/lein diff --git a/manage.sh b/manage.sh index 3566c6712..f28505ded 100755 --- a/manage.sh +++ b/manage.sh @@ -69,22 +69,18 @@ function release_local { function release_image { echo "Building frontend release..." rm -rf ./frontend/dist ./frontend/node_modules ./frontend/dist - sudo docker build --rm=true -t $IMGNAME-frontend:$REV frontend/ + sudo docker build --rm=true -t ${IMGNAME}_frontend:$REV frontend/ echo "Frontend release image generated" echo "Building backend release..." rm -rf ./backend/dist - sudo docker build --rm=true -t $IMGNAME-backend:$REV backend/ + sudo docker build --rm=true -t ${IMGNAME}_backend:$REV backend/ echo "Backend release image generated" } function run_release { kill_container - if ! $(sudo docker images | grep $IMGNAME-frontend | grep -q $REV); then - release_image - fi - echo "Running production images..." sudo docker-compose up -d }