-
Notifications
You must be signed in to change notification settings - Fork 380
[Init] Dockerfile & docker-compose.yml #578
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
Closed
Closed
Changes from all commits
Commits
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
[Init] Dockerfile & docker-compose.yml
- Loading branch information
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
Dockerfile
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,34 @@ | ||
| FROM ruby:3.1-bullseye | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy Gemfile and install dependencies | ||
| COPY Gemfile Gemfile.lock ./ | ||
| RUN bundle install | ||
|
|
||
| # RUN apt-get install mysql-client | ||
| RUN apt-get install -y curl \ | ||
| && curl -sL https://deb.nodesource.com/setup_20.x | bash - \ | ||
| && apt-get install -y nodejs \ | ||
| && curl -L https://www.npmjs.com/install.sh | sh | ||
|
|
||
| RUN apt-get install -y redis | ||
|
|
||
| RUN npm install -g yarn | ||
|
|
||
| # Copy application code | ||
| COPY . . | ||
|
|
||
| RUN yarn | ||
| RUN yarn res:dev | ||
|
|
||
| # Expose port 3000 | ||
| EXPOSE 3000 | ||
|
|
||
| # Start the Rails server | ||
| # RUN rake db:setup | ||
|
|
||
| # CMD ["rails", "server", "-b", "0.0.0.0"] | ||
| CMD [ "foreman", "start", "-f", "Procfile.dev" ] | ||
| # CMD ["ruby", "bin/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
4 changes: 2 additions & 2 deletions
Procfile.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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # Procfile for development using HMR | ||
| # You can run these commands in separate shells | ||
| rescript: yarn res:dev | ||
| # rescript: yarn res:dev | ||
| redis: redis-server | ||
| rails: bundle exec rails s -p 3000 | ||
| rails: bundle exec rails s -p 3000 -b 0.0.0.0 | ||
| wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/shakapacker-dev-server | ||
| wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/shakapacker --watch |
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
17 changes: 17 additions & 0 deletions
docker-compose.yml
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,17 @@ | ||
| version: "3.9" | ||
| services: | ||
| app: | ||
| # run `docker build -t my-rails-app .` to build the image | ||
| image: my-rails-app | ||
| environment: | ||
| DB_NAME: db | ||
| DB_USER: root | ||
| DB_PASSWD: password | ||
| DB_HOST: host.docker.internal | ||
| ports: | ||
| - 3000:3000 | ||
| # I'm not using another container for the DB so commenting this | ||
| # db: | ||
| # image: postgres:alpine3.15 | ||
| # environment: | ||
| # POSTGRES_PASSWORD: example |
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.