-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enable containerized demo #64
Open
iguanus
wants to merge
6
commits into
master
Choose a base branch
from
ig-zzz-containerize
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
6 commits
Select commit
Hold shift + click to select a range
cbafa85
[CHORE] Initial Dockerfile
iguanus 8600667
[CHORE] Leverage foreman to run the project
iguanus cc588af
[CHORE] Simple compose file for ease of use
iguanus 311ea01
[CHORE] .env for adding the name of the compose file
iguanus adff743
[CHORE] Enable remote access, as the container is not where the brows…
iguanus c1c2369
[CHORE] Add line ends
iguanus 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 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,2 @@ | ||
# Provides the name of the project for docker | ||
COMPOSE_PROJECT_NAME=ror_ssr_hmr |
This file contains 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,36 @@ | ||
FROM ruby:3.1.2 | ||
|
||
# Install Node.js | ||
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - | ||
RUN apt-get install -y nodejs | ||
|
||
# Install yarn version 3.2.1 | ||
RUN node -v && npm i -g yarn && yarn set version 3.2.1 | ||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Install foreman to leverage Procfile | ||
RUN gem install foreman | ||
|
||
# Copy node package maps | ||
COPY .yarnrc.yml package.json yarn.lock /app/ | ||
COPY .yarn/ /app/.yarn/ | ||
|
||
COPY Gemfile* /app | ||
# Install Gemfile | ||
RUN bundle install | ||
|
||
# Install node modules | ||
RUN yarn install | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Expose the rails app to outside the container | ||
EXPOSE 3000 | ||
|
||
# Expose hmr server to outside the container | ||
EXPOSE 3035 | ||
|
||
# Run the app when the container launches | ||
CMD ["foreman", "start", "-f", "Procfile.dev"] |
This file contains 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,5 +1,5 @@ | ||
# Procfile for development using HMR | ||
# You can run these commands in separate shells | ||
rails: bundle exec rails s -p 3000 | ||
rails: bundle exec rails s -b 0.0.0.0 -p 3000 | ||
wp-client: bin/shakapacker-dev-server | ||
wp-server: SERVER_BUNDLE_ONLY=yes bin/shakapacker --watch |
This file contains 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,13 @@ | ||
services: | ||
rails: | ||
build: . | ||
image: ror_ssr_hmr:1.0.0 | ||
volumes: | ||
- node_modules:/app/node_modules | ||
- .:/app | ||
ports: | ||
- 3000:3000 | ||
- 3035:3035 | ||
|
||
volumes: | ||
node_modules: |
This file contains 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 |
---|---|---|
|
@@ -23,7 +23,7 @@ development: | |
# Reference: https://webpack.js.org/configuration/dev-server/ | ||
dev_server: | ||
https: false | ||
host: localhost | ||
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.
For truly remote, such as CodeSpaces, one might also need to change the allowed list below |
||
host: 0.0.0.0 | ||
port: 3035 | ||
# Hot Module Replacement updates modules while the application is running without a full reload | ||
hmr: true | ||
|
Oops, something went wrong.
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.
Enable accepting requests from outside the container, like from the browser.