Skip to content

Commit bc6ec09

Browse files
committed
build: Minor updates to the Docker dev setup
1 parent fed6610 commit bc6ec09

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ shell:
1616
specs:
1717
@docker compose -f extra/docker-compose.yml exec app_with_${DB} bin/rspec --fail-fast
1818

19+
console:
20+
@docker compose -f extra/docker-compose.yml exec app_with_${DB} bin/rails c
21+
1922
server:
2023
@docker compose -f extra/docker-compose.yml exec app_with_${DB} bin/rails s -b 0.0.0.0 -p ${SERVER_PORT}
2124

extra/.bashrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alias ls='ls --color'
2+
alias ll='ls -l'
3+
alias la='ls -la'

extra/.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
COMPOSE_PROJECT_NAME=active_storage_db
22

3+
BUNDLER_VERSION=2.5.23
4+
SERVER_PORT=4000
5+
36
UID=1000
47
GID=1000
5-
6-
SERVER_PORT=4000

extra/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@ ENV DEVEL=1
66
ENV LANG=C.UTF-8
77

88
RUN apt-get update -qq
9-
RUN apt-get install -yqq --no-install-recommends build-essential nano netcat-traditional pkg-config
9+
RUN apt-get install -yqq --no-install-recommends build-essential less nano netcat-traditional pkg-config
1010
RUN apt-get install -yqq --no-install-recommends freetds-dev libmariadb-dev libpq-dev libvips42 libyaml-dev sqlite3
1111

12-
RUN gem install bundler -v 2.5.23
12+
ARG BUNDLER_VERSION
13+
RUN gem install bundler -v ${BUNDLER_VERSION}
1314
RUN echo 'gem: --no-document' > /etc/gemrc
1415

1516
ARG UID
1617
RUN useradd -u $UID --shell /bin/bash app
1718

18-
RUN mkdir -p /home/app
19-
RUN chown -R app:app /home/app
20-
RUN chown -R app /usr/local/bundle
19+
RUN mkdir -p /home/app && chown -R app:app /home/app
2120

2221
ARG RAILS_VERSION
2322
ENV RAILS_VERSION=$RAILS_VERSION
2423

2524
WORKDIR /app
2625
COPY . /app
2726
RUN bundle install
28-
RUN chown -R app:app /app/spec/dummy/db
27+
RUN chown -R app:app /app/spec/dummy/db /usr/local/bundle
28+
29+
RUN ln -s /app/extra/.bashrc /home/app/.bashrc

extra/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ services:
44
context: ..
55
dockerfile: extra/Dockerfile
66
args:
7-
# Debian-based Ruby image:
8-
RUBY_IMAGE: ruby:${RUBY:-3.2}-slim
7+
RUBY_IMAGE: ruby:${RUBY:-3.4}-slim
98
RAILS_VERSION: ${RAILS:-}
9+
BUNDLER_VERSION: ${BUNDLER_VERSION}
1010
UID: ${UID}
1111
user: ${UID}:${GID}
1212
ports:

0 commit comments

Comments
 (0)