Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare docs for new release (#1076)
- Loading branch information
1 parent
b25c5a9
commit 8191805
Showing
7 changed files
with
216 additions
and
24 deletions.
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
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
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
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
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,49 @@ | ||
# Docker | ||
|
||
To setup webpacker with a dockerized Rails application is trivial. | ||
|
||
First, add a new service for webpacker in docker-compose.yml: | ||
|
||
```Dockerfile | ||
version: '3' | ||
services: | ||
webpacker: | ||
build: . | ||
env_file: | ||
- '.env.docker' | ||
command: bundle exec webpack-dev-server | ||
volumes: | ||
- .:/webpacker-example-app | ||
ports: | ||
- '3035:3035' | ||
``` | ||
|
||
add nodejs and yarn as dependencies in Dockerfile, | ||
|
||
```dockerfile | ||
FROM ruby:2.4.1 | ||
RUN apt-get update -qq | ||
|
||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
|
||
RUN apt-get install -y nodejs | ||
RUN apt-get update && apt-get install yarn | ||
|
||
# Rest of the commands.... | ||
``` | ||
|
||
and create an env file to load environment variables from: | ||
|
||
```env | ||
NODE_ENV=development | ||
RAILS_ENV=development | ||
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0 | ||
``` | ||
|
||
Lastly, rebuild your container: | ||
|
||
```bash | ||
docker-compose up --build | ||
``` |
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,4 +1,4 @@ | ||
# webpack Dev Server | ||
# webpack-dev-server | ||
|
||
|
||
## HTTPS | ||
|
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