Merge pull request 'Fix docker volume mappings for node_modules, improve docker-compose usage' (#138) from bugfix/fix-docker-mapping into master
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #138
Reviewed-by: raucao <raucao@noreply.kosmos.org>
This commit is contained in:
Râu Cao 2023-06-23 15:38:30 +00:00
commit b32e2fcb7b
3 changed files with 61 additions and 57 deletions

View File

@ -9,9 +9,9 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get update && apt-get install -y nodejs RUN apt-get update && apt-get install -y nodejs
WORKDIR /akkounts WORKDIR /akkounts
COPY Gemfile /akkounts/Gemfile
COPY Gemfile.lock /akkounts/Gemfile.lock COPY ["Gemfile", "Gemfile.lock", "package.json", "./"]
COPY package.json /akkounts/package.json
RUN bundle install RUN bundle install
RUN gem install foreman RUN gem install foreman
RUN npm install -g yarn RUN npm install -g yarn

View File

@ -14,7 +14,6 @@ so:
1. Make sure [Docker Compose is installed][1] and Docker is running (included in 1. Make sure [Docker Compose is installed][1] and Docker is running (included in
Docker Desktop) 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 3. Run `docker compose up` and wait until 389ds announces its successful start
in the log output in the log output
4. `docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"` 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) ### 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. 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 For Rails developers, you probably just want to start the LDAP server: `docker-compose up ldap`,
port 389 on your machine. Uncomment other services in `docker-compose.yml` if listening on port 389 on your machine.
you want to use them.
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 #### LDAP server

View File

@ -12,57 +12,60 @@ services:
DS_DM_PASSWORD: passthebutter DS_DM_PASSWORD: passthebutter
SUFFIX_NAME: "dc=kosmos,dc=org" SUFFIX_NAME: "dc=kosmos,dc=org"
# redis: redis:
# restart: always restart: always
# image: redis:7-alpine image: redis:7-alpine
# networks: networks:
# - internal_network - internal_network
# healthcheck: healthcheck:
# test: ['CMD', 'redis-cli', 'ping'] test: ['CMD', 'redis-cli', 'ping']
# volumes: volumes:
# - ./tmp/redis:/data - ./tmp/redis:/data
# web: web:
# build: . build: .
# tty: true tty: true
# command: bash -c "rm -f /akkounts/tmp/pids/server.pid; bin/dev" command: bash -c "rm -f /akkounts/tmp/pids/server.pid; bin/dev"
# volumes: volumes:
# - .:/akkounts - .:/akkounts
# networks: - /akkounts/node_modules
# - external_network networks:
# - internal_network - external_network
# ports: - internal_network
# - "3000:3000" ports:
# environment: - "3000:3000"
# RAILS_ENV: development environment:
# REDIS_URL: redis://redis:6379/0 RAILS_ENV: development
# LDAP_HOST: ldap PRIMARY_DOMAIN: kosmos.org
# LDAP_PORT: 3389 REDIS_URL: redis://redis:6379/0
# LDAP_ADMIN_PASSWORD: passthebutter LDAP_HOST: ldap
# LDAP_USE_TLS: "false" LDAP_PORT: 3389
# depends_on: LDAP_ADMIN_PASSWORD: passthebutter
# - ldap LDAP_USE_TLS: "false"
# - redis depends_on:
- ldap
- redis
# sidekiq: sidekiq:
# build: . build: .
# command: bash -c "bundle exec sidekiq -C config/sidekiq.yml" command: bash -c "bundle exec sidekiq -C config/sidekiq.yml"
# volumes: volumes:
# - .:/akkounts - .:/akkounts
# networks: networks:
# - internal_network - internal_network
# environment: environment:
# RAILS_ENV: development RAILS_ENV: development
# REDIS_URL: redis://redis:6379/0 PRIMARY_DOMAIN: kosmos.org
# LDAP_HOST: ldap REDIS_URL: redis://redis:6379/0
# LDAP_PORT: 3389 LDAP_HOST: ldap
# LDAP_ADMIN_PASSWORD: passthebutter LDAP_PORT: 3389
# LDAP_USE_TLS: "false" LDAP_ADMIN_PASSWORD: passthebutter
# LAUNCHY_DRY_RUN: true LDAP_USE_TLS: "false"
# BROWSER: /dev/null LAUNCHY_DRY_RUN: true
# depends_on: BROWSER: /dev/null
# - ldap depends_on:
# - redis - ldap
- redis
# phpldapadmin: # phpldapadmin:
# image: osixia/phpldapadmin:0.9.0 # image: osixia/phpldapadmin:0.9.0