diff --git a/.env b/.env new file mode 100644 index 000000000..2fc80e3a4 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +PORT=3000 diff --git a/Makefile b/Makefile index 176e64d8d..c04f5e046 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,11 @@ export COMPOSE_HTTP_TIMEOUT=360 build: cp config/database.yml.example config/database.yml cp db/schema.rb.example db/schema.rb + docker-compose down --remove-orphans docker-compose build - docker-compose run --rm web bash -l -c "sleep 10 && bower install --allow-root && rake db:setup && rake db:migrate && rake assets:precompile" deploy-container: + docker-compose run --rm web bash -l -c "sleep 10 && bower install --allow-root && rake db:setup && rake db:migrate && rake assets:precompile" docker-compose up -d redeploy-container: diff --git a/docker-compose.yml b/docker-compose.yml index 5f3d5987e..32e3902c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,13 @@ version: '3.3' services: db: - container_name: db image: mysql:5.7 env_file: - mapknitter.env volumes: - ../mysql:/var/lib/mysql + - ../dump:/docker-entrypoint-initdb.d web: - container_name: web build: . env_file: - mapknitter.env @@ -17,7 +16,7 @@ services: - bundle_cache:/usr/local/bundle - bower_cache:/app/public/lib ports: - - 3000:3000 + - $PORT:3000 depends_on: - db