Don't use entrypoints in docker

This commit is contained in:
Vincent 2019-04-17 17:16:21 +02:00
parent 5204e19ee7
commit e4fb706809
4 changed files with 8 additions and 35 deletions

View File

@ -17,10 +17,10 @@ services:
restart: unless-stopped restart: unless-stopped
build: ./js build: ./js
volumes: volumes:
- './js:/app/js' - '.:/app'
ports: ports:
- "8888:8080" - "8888:8080"
entrypoint: entrypoint command: yarn run dev
api: api:
container_name: mobilizon_api container_name: mobilizon_api
@ -32,10 +32,9 @@ services:
- "4000:4001" - "4000:4001"
depends_on: depends_on:
- postgres - postgres
- front
environment: environment:
# Environment: Prod when ready MIX_ENV: "dev"
MIX_ENV: dev
# Instance
MOBILIZON_INSTANCE_NAME: My Mobilizon Instance MOBILIZON_INSTANCE_NAME: My Mobilizon Instance
MOBILIZON_INSTANCE_HOST: mobilizon.me MOBILIZON_INSTANCE_HOST: mobilizon.me
MOBILIZON_INSTANCE_EMAIL: noreply@mobilizon.me MOBILIZON_INSTANCE_EMAIL: noreply@mobilizon.me
@ -44,7 +43,7 @@ services:
MOBILIZON_DATABASE_USERNAME: postgres MOBILIZON_DATABASE_USERNAME: postgres
MOBILIZON_DATABASE_DBNAME: mobilizon_dev MOBILIZON_DATABASE_DBNAME: mobilizon_dev
MOBILIZON_DATABASE_HOST: postgres MOBILIZON_DATABASE_HOST: postgres
entrypoint: entrypoint command: "mix phx.migrate_serve"
volumes: volumes:
pgdata: pgdata:
.: .:

View File

@ -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

View File

@ -2,8 +2,9 @@ FROM node:10
LABEL maintainer="tcit" LABEL maintainer="tcit"
COPY docker/entrypoint.sh /bin/entrypoint RUN yarn install
RUN yarn upgrade node-sass
WORKDIR /app/js WORKDIR /app/js
EXPOSE 8080 EXPOSE 8080

View File

@ -1,5 +0,0 @@
#!/bin/bash
yan install
yarn rebuild node-sass
yarn run dev