Skip to content

Commit

Permalink
Assets and Elastic Search error in docker (#418)
Browse files Browse the repository at this point in the history
  **Motivation and Context**
 
 Docker setup of Aviacommerce on Linux machine is facing the below two problems
   + Elastic Search was exiting with code 78. This was due to low 'max file descriptor size' and low 'max 
        virtual memory'.
   + Assets were not getting installed automatically. 


  **Describe your changes**
   + Made changes in Dockerfile-dev to resolve the assets problem.
   + Made changes in  docker-compose-dev.yml to resolve elastic search problem as it
    was getting stopped due to low descriptor size

## Why?
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
<!--- If it delivers a story on the Pivotal tracker, please link to it here. -->

## This change addresses the need by:
<!--- List and detail all changes made in this PR. -->

[delivers #162446059]

## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have read [CONTRIBUTING.md][contributing].
- [ ] My code follows the [style guidelines][contributing] of this project.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] My code does not generate any (new) [`credo`][credo] and compile-time warnings.
- [ ] I have updated the documentation wherever necessary.
- [ ] I have added tests to cover my changes.

[contributing]: https://github.com/aviabird/snitch/CONTRIBUTING.md
[credo]: https://github.com/rrrene/credo
  • Loading branch information
Jeshan7 authored and Vikram Singh Jadon committed Jan 15, 2019
1 parent c896875 commit 200230e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/snitch_core/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ config :snitch_core, Snitch.Repo,
username: "postgres",
password: "postgres",
database: "snitch_dev",
hostname: "localhost",
hostname: System.get_env("DB_HOST"),
pool_size: 10

config :snitch_core, :defaults_module, Snitch.Tools.Defaults
Expand Down
6 changes: 5 additions & 1 deletion config/docker/dev/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV HOSTED_PAYMENT_URL http://localhost:3000/api/v1/hosted-payment/
ENV SUPPORT_URL https://admin.aviacommerce.org
ENV WKHTML_PATH /usr/bin/wkhtmltopdf
ENV ELASTIC_HOST http://localhost:9200/
ENV DB_HOST db

RUN mkdir $APP_HOME
WORKDIR $APP_HOME
Expand Down Expand Up @@ -68,7 +69,10 @@ RUN apt-get clean \
&& apt-get -y autoremove \
&& apt-get -y clean


RUN cd apps/admin_app/assets \
&& yarn install

RUN ["chmod", "+x", "./config/docker/dev/docker-dev-provision.sh"]

CMD ["./config/docker/dev/docker-dev-provision.sh"]

6 changes: 4 additions & 2 deletions config/docker/dev/docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '3'
services:
webapp:
build:
Expand Down Expand Up @@ -28,11 +28,13 @@ services:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9200:9200"
kibana:
image: docker.elastic.co/kibana/kibana:6.3.2
ports:
- "5601:5601"
container_name: kibana

1 change: 1 addition & 0 deletions env/local.env.remove_me
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export [email protected]
export FRONTEND_URL=http://localhost:4200/
export BACKEND_URL=http://localhost:4000/
export ELASTIC_HOST=http://localhost:9200/
export DB_HOST=localhost


# Keys for Avia app to import products
Expand Down
1 change: 1 addition & 0 deletions env/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export SENDGRID_SENDER_EMAIL=
export FRONTEND_URL=http://localhost:4200/
export BACKEND_URL=http://localhost:4000/
export ELASTIC_HOST=http://localhost:9200/
export DB_HOST=localhost


# Keys for Avia app to import products
Expand Down

0 comments on commit 200230e

Please sign in to comment.