-
Notifications
You must be signed in to change notification settings - Fork 0
Add Docker configuration #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
the-teacher
wants to merge
9
commits into
master
Choose a base branch
from
add-docker-configuration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
63e6335
Add docker configuration
0d1645c
Add docker manual to README
3cb6b06
Improve the docs
76c4531
Docker first
4c84f0c
Readme
7ed4ddf
Improve the readme
df2fbb5
fix typo
57d050f
add missing text
a201796
Update Dockerfile
azrocketa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| FROM ruby:2.3-jessie | ||
|
|
||
| ENV APP_HOME=/app | ||
| ENV BUNDLER_GEMFILE=/app/Gemfile | ||
| ENV BUNDLE_PATH=/gems | ||
| ENV LANG=C.UTF-8 | ||
| ENV LANGUAGE="$LANG" | ||
| ENV LC_ALL="$LANG" | ||
| ENV TZ=Europe/Moscow | ||
|
|
||
| RUN mkdir $APP_HOME \ | ||
| && echo "en_US ISO-8859-1" > /etc/locale.gen \ | ||
| && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ | ||
| && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ | ||
| && echo "ru_RU ISO-8859-5" >> /etc/locale.gen \ | ||
| && echo "ru_RU.CP1251 CP1251" >> /etc/locale.gen \ | ||
| && echo "ru_RU.KOI8-R KOI8-R" >> /etc/locale.gen \ | ||
| && echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen \ | ||
| && echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen \ | ||
| && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ | ||
| && echo $TZ > /etc/timezone \ | ||
| && apt-get update \ | ||
| && apt-get install -y \ | ||
| libmysqlclient-dev \ | ||
| libpq-dev \ | ||
| libssl-dev \ | ||
| locales \ | ||
| mysql-client \ | ||
| nodejs \ | ||
| postgresql-client \ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
| sqlite3 \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR $APP_HOME | ||
| ADD Gemfile* $APP_HOME/ | ||
| ADD . $APP_HOME | ||
|
|
||
| RUN gem install bundler -v 1.17.3 \ | ||
| && bundle install --deployment --without development test --with plugins --jobs=3 | ||
|
|
||
| EXPOSE 3000 | ||
| CMD [ "bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "3000" ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| ## Установка с помощью docker и docker-compose | ||
|
|
||
| **1. Необходимое ПО** | ||
|
|
||
| - [Docker](https://docs.docker.com/get-started/) | ||
| - [Docker Compose](https://docs.docker.com/compose/) | ||
|
|
||
| *Проверить наличие* | ||
|
|
||
| ```bash | ||
| $ docker -v | ||
| > Docker version 19.03.1 | ||
|
|
||
| $ docker-compose -v | ||
| > docker-compose version 1.24.1 | ||
| ``` | ||
|
|
||
| **2. Скопируйте конфигурационные файлы** | ||
|
|
||
| - `cp -R config/config.examples/ENV/ config/ENV` | ||
| - `cp config/config.examples/database.yml config/database.yml` | ||
|
|
||
| **3. Запустить команду для поднятия окружения** | ||
|
|
||
| - `docker-compose --verbose build` | ||
|
|
||
| **4. Архив данных для разработки** | ||
|
|
||
| - Получите архив данных для разработки `obfuscated_data.tar.gz` (Смотри: [data_obfuscation.rake](lib/tasks/README.md)) | ||
| - Поместите архив к каталог `./tmp` | ||
| - Распакуйте архив | ||
| ``` | ||
| mkdir -p ./tmp/untar | ||
|
|
||
| tar xvzf ./tmp/obfuscated_data.tar.gz -C ./tmp/untar | ||
| ``` | ||
|
|
||
| **5. Скопируйте фалйы в каталог ./public** | ||
|
|
||
| `Не проверено` | ||
|
|
||
| **6. Загрузите Базу Данных** | ||
|
|
||
| `Не проверено` | ||
|
|
||
| - `docker cp Developer/open-cook.ru.rails_app_db.dump ok-2018_postgres_1:/` | ||
| - `docker exec ok-2018_postgres_1 pg_restore -U postgres -d open_cook_dev backups/open-cook.ru.rails_app_db.dump` | ||
|
|
||
| **7. Проиндексируйте данные для Поиска** | ||
|
|
||
| `Не проверено` | ||
|
|
||
| - `docker exec ok-2018_web_1 rake ts:configure ts:restart` | ||
| - `docker exec ok-2018_web_1 rake ts:index` | ||
|
|
||
| **8. Запустите проект** | ||
|
|
||
| - `docker-compose up` | ||
|
|
||
| **9. Доступ в Rails console** | ||
|
|
||
| `Не проверено` | ||
|
|
||
| **10. Выполение rake tasks и других команд в контейнере** | ||
|
|
||
| `Не проверено` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| development: | ||
| host: postgres | ||
| adapter: postgresql | ||
| encoding: unicode | ||
| database: open_cook_dev | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| version: '3' | ||
| services: | ||
| # postgres: | ||
| # image: postgres:11 | ||
| # restart: always | ||
| # environment: | ||
| # - POSTGRES_DATABSE=open_cook_dev | ||
| # - POSTGRES_DB=open_cook_dev | ||
| # - POSTGRES_USER=postgres | ||
| # - POSTGRES_PASSWORD=postgres | ||
| # volumes: | ||
| # - ./data:/var/lib/postgresql/data | ||
|
|
||
| redis: | ||
| image: 'redis:4.0-alpine' | ||
| command: redis-server | ||
| volumes: | ||
| - './data:/var/lib/redis/data' | ||
|
|
||
| mysql: | ||
| image: mysql:5.7 | ||
| restart: always | ||
| command: --explicit_defaults_for_timestamp | ||
| environment: | ||
| MYSQL_DATABASE: 'db' | ||
| MYSQL_USER: 'user' | ||
| MYSQL_PASSWORD: 'password' | ||
| MYSQL_ROOT_PASSWORD: 'password' | ||
| ports: | ||
| - '3306:3306' | ||
| expose: | ||
| - '3306' | ||
| volumes: | ||
| - ./data:/var/lib/mysql/data | ||
|
|
||
| web: | ||
| build: . | ||
| command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" | ||
| volumes: | ||
| - .:/myapp | ||
| ports: | ||
| - "3000:3000" | ||
| links: | ||
| - postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?