diff --git a/Dockerfile b/Dockerfile index f2692e7..ff3eef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,9 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - RUN apt-get update && apt-get install -y nodejs WORKDIR /akkounts -COPY Gemfile /akkounts/Gemfile -COPY Gemfile.lock /akkounts/Gemfile.lock -COPY package.json /akkounts/package.json + +COPY ["Gemfile", "Gemfile.lock", "package.json", "./"] + RUN bundle install RUN gem install foreman RUN npm install -g yarn diff --git a/README.md b/README.md index f14c3de..5a177e9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ so: 1. Make sure [Docker Compose is installed][1] and Docker is running (included in Docker Desktop) -2. Uncomment the `redis`, `web`, and `sidekiq` sections in `docker-compose.yml` 3. Run `docker compose up` and wait until 389ds announces its successful start in the log output 4. `docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"` @@ -53,12 +52,14 @@ Running all specs: ### Docker (Compose) -There is a working Docker Compose config file, which allows you to spin up both +There is a working Docker Compose config file, which define a number of services including an app server for Rails as well as a local 389ds (LDAP) server. -By default, `docker-compose up` will only start the LDAP server, listening on -port 389 on your machine. Uncomment other services in `docker-compose.yml` if -you want to use them. +For Rails developers, you probably just want to start the LDAP server: `docker-compose up ldap`, +listening on port 389 on your machine. + +You can pick and choose your services adding them by name (listed in `docker-compose.yml`) at +the end of the docker compose command. eg. `docker compose up ldap redis` #### LDAP server diff --git a/docker-compose.yml b/docker-compose.yml index 8a0de47..9242fb6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,57 +12,60 @@ services: DS_DM_PASSWORD: passthebutter SUFFIX_NAME: "dc=kosmos,dc=org" - # redis: - # restart: always - # image: redis:7-alpine - # networks: - # - internal_network - # healthcheck: - # test: ['CMD', 'redis-cli', 'ping'] - # volumes: - # - ./tmp/redis:/data + redis: + restart: always + image: redis:7-alpine + networks: + - internal_network + healthcheck: + test: ['CMD', 'redis-cli', 'ping'] + volumes: + - ./tmp/redis:/data - # web: - # build: . - # tty: true - # command: bash -c "rm -f /akkounts/tmp/pids/server.pid; bin/dev" - # volumes: - # - .:/akkounts - # networks: - # - external_network - # - internal_network - # ports: - # - "3000:3000" - # environment: - # RAILS_ENV: development - # REDIS_URL: redis://redis:6379/0 - # LDAP_HOST: ldap - # LDAP_PORT: 3389 - # LDAP_ADMIN_PASSWORD: passthebutter - # LDAP_USE_TLS: "false" - # depends_on: - # - ldap - # - redis + web: + build: . + tty: true + command: bash -c "rm -f /akkounts/tmp/pids/server.pid; bin/dev" + volumes: + - .:/akkounts + - /akkounts/node_modules + networks: + - external_network + - internal_network + ports: + - "3000:3000" + environment: + RAILS_ENV: development + PRIMARY_DOMAIN: kosmos.org + REDIS_URL: redis://redis:6379/0 + LDAP_HOST: ldap + LDAP_PORT: 3389 + LDAP_ADMIN_PASSWORD: passthebutter + LDAP_USE_TLS: "false" + depends_on: + - ldap + - redis - # sidekiq: - # build: . - # command: bash -c "bundle exec sidekiq -C config/sidekiq.yml" - # volumes: - # - .:/akkounts - # networks: - # - internal_network - # environment: - # RAILS_ENV: development - # REDIS_URL: redis://redis:6379/0 - # LDAP_HOST: ldap - # LDAP_PORT: 3389 - # LDAP_ADMIN_PASSWORD: passthebutter - # LDAP_USE_TLS: "false" - # LAUNCHY_DRY_RUN: true - # BROWSER: /dev/null - # depends_on: - # - ldap - # - redis + sidekiq: + build: . + command: bash -c "bundle exec sidekiq -C config/sidekiq.yml" + volumes: + - .:/akkounts + networks: + - internal_network + environment: + RAILS_ENV: development + PRIMARY_DOMAIN: kosmos.org + REDIS_URL: redis://redis:6379/0 + LDAP_HOST: ldap + LDAP_PORT: 3389 + LDAP_ADMIN_PASSWORD: passthebutter + LDAP_USE_TLS: "false" + LAUNCHY_DRY_RUN: true + BROWSER: /dev/null + depends_on: + - ldap + - redis # phpldapadmin: # image: osixia/phpldapadmin:0.9.0