forked from e621ng/e621ng
[Docker] Install gems and js packages into the image
To see the changes persisted into the container run `docker-compose` build `docker-compose down -v` no longer requires to reinstall gems/packages It's also possible to have branches with different gemfiles, without having to install between them constantly
This commit is contained in:
parent
8d2bd155f3
commit
82d7ff59e0
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@ -0,0 +1,8 @@
|
||||
# Ignore everything
|
||||
**
|
||||
|
||||
# Allow only the files that are actually needed
|
||||
!/package.json
|
||||
!/yarn.lock
|
||||
!/Gemfile
|
||||
!/Gemfile.lock
|
@ -4,10 +4,16 @@ FROM ruby:2.7.3-alpine
|
||||
RUN apk --no-cache add nodejs yarn postgresql-client ffmpeg vips tzdata \
|
||||
git build-base postgresql-dev glib-dev
|
||||
|
||||
|
||||
# Nice to have packages
|
||||
RUN apk --no-cache add nano sudo bash
|
||||
|
||||
# Install js packages and gems
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install
|
||||
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
RUN bundle install
|
||||
|
||||
# shoreman
|
||||
RUN wget -O /usr/bin/shoreman https://github.com/chrismytton/shoreman/raw/master/shoreman.sh \
|
||||
&& chmod +x /usr/bin/shoreman
|
@ -27,6 +27,8 @@ To mitigate this you can install a WSL distribution and clone the project inside
|
||||
By the time you get back the install will surely have completed.<sup>1</sup>
|
||||
6. To confirm the installation worked, open the web browser of your choice and enter `http://localhost:3000` into the address bar and see if the website loads correctly.
|
||||
|
||||
Note: When gems or js packages were updated you need to execute `docker-compose build` to reflect them in the container.
|
||||
|
||||
<sub><sup>1</sup> If the install did not finish by the time an activity is complete please select another activity to avoid crippling boredom.</sub>
|
||||
|
||||
#### Development Database
|
||||
|
@ -2,14 +2,13 @@ version: "3"
|
||||
|
||||
services:
|
||||
e621:
|
||||
build: ./docker
|
||||
build: ./
|
||||
volumes:
|
||||
- .:/app
|
||||
- node_modules:/app/node_modules
|
||||
- public_packs:/app/public/packs
|
||||
- public_packs_test:/app/public/packs-test
|
||||
- post_data:/app/public/data
|
||||
- gems:/usr/local/bundle
|
||||
environment:
|
||||
DATABASE_URL: postgresql://danbooru:@postgres
|
||||
RAILS_ENV: development
|
||||
@ -76,7 +75,6 @@ volumes:
|
||||
elastic_data:
|
||||
db_data:
|
||||
redis_data:
|
||||
gems:
|
||||
node_modules:
|
||||
public_packs:
|
||||
public_packs_test:
|
||||
|
Loading…
Reference in New Issue
Block a user