From 040266a65602411222f98ea27bdd3c7242fa0a70 Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 17 Apr 2019 17:16:21 +0200 Subject: [PATCH] Don't use entrypoints in docker --- docker-compose.yml | 11 +++++------ docker/entrypoint.sh | 22 ---------------------- js/Dockerfile | 5 +++-- js/docker/entrypoint.sh | 5 ----- 4 files changed, 8 insertions(+), 35 deletions(-) delete mode 100755 docker/entrypoint.sh delete mode 100755 js/docker/entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index b454a7092..82fed99d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,10 +17,10 @@ services: restart: unless-stopped build: ./js volumes: - - './js:/app/js' + - '.:/app' ports: - "8888:8080" - entrypoint: entrypoint + command: yarn run dev api: container_name: mobilizon_api @@ -32,10 +32,9 @@ services: - "4000:4001" depends_on: - postgres + - front environment: - # Environment: Prod when ready - MIX_ENV: dev - # Instance + MIX_ENV: "dev" MOBILIZON_INSTANCE_NAME: My Mobilizon Instance MOBILIZON_INSTANCE_HOST: mobilizon.me MOBILIZON_INSTANCE_EMAIL: noreply@mobilizon.me @@ -44,7 +43,7 @@ services: MOBILIZON_DATABASE_USERNAME: postgres MOBILIZON_DATABASE_DBNAME: mobilizon_dev MOBILIZON_DATABASE_HOST: postgres - entrypoint: entrypoint + command: "mix phx.migrate_serve" volumes: pgdata: .: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index 4c3955783..000000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -mix deps.get - -# Wait for Postgres to become available. -until PGPASSWORD=$MOBILIZON_DATABASE_PASSWORD psql -h $MOBILIZON_DATABASE_HOST -U $MOBILIZON_DATABASE_USERNAME -c '\q' 2>/dev/null; do - >&2 echo "Postgres is unavailable - sleeping" - sleep 1 -done - -echo "\nPostgres is available: continuing with database setup..." - -# Potentially Set up the database -mix ecto.create -mix ecto.migrate - -echo "\nTesting the installation..." -# "Proove" that install was successful by running the tests -mix test - -echo "\n Launching Phoenix web server..." -iex -S mix phx.server \ No newline at end of file diff --git a/js/Dockerfile b/js/Dockerfile index 55c74eded..d9db3df21 100644 --- a/js/Dockerfile +++ b/js/Dockerfile @@ -2,8 +2,9 @@ FROM node:10 LABEL maintainer="tcit" -COPY docker/entrypoint.sh /bin/entrypoint +RUN yarn install +RUN yarn upgrade node-sass WORKDIR /app/js -EXPOSE 8080 \ No newline at end of file +EXPOSE 8080 diff --git a/js/docker/entrypoint.sh b/js/docker/entrypoint.sh deleted file mode 100755 index 24be99c19..000000000 --- a/js/docker/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -yan install -yarn rebuild node-sass -yarn run dev