Skip to content

Commit 0bd5566

Browse files
authored
putting api on a diet (ship:docker) (#1250)
1 parent e036f1b commit 0bd5566

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Dockerfile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@ FROM ruby:2.7.5-slim
22

33
LABEL maintainer Travis CI GmbH <[email protected]>
44

5-
# packages required for bundle install
5+
RUN ( \
6+
bundle config set no-cache 'true'; \
7+
bundle config --global frozen 1; \
8+
bundle config set deployment 'true'; \
9+
mkdir -p /app; \
10+
)
11+
12+
WORKDIR /app
13+
14+
COPY Gemfile* /app/
15+
616
RUN ( \
717
apt-get update ; \
8-
# update to deb 10.8
918
apt-get upgrade -y ; \
1019
apt-get install -y --no-install-recommends git make gcc g++ libpq-dev libjemalloc-dev \
1120
&& rm -rf /var/lib/apt/lists/* \
21+
gem install bundler -v '2.3.6'; \
22+
bundle config set without 'development test'; \
23+
bundler install --verbose --retry=3; \
24+
bundle config set frozen true; \
25+
apt-get remove -y gcc g++ make git perl && apt-get -y autoremove; \
26+
bundle clean && rm -rf /app/vendor/bundle/ruby/2.7.0/cache/*; \
27+
for i in `find /app/vendor/ -name \*.o -o -name \*.c -o -name \*.h`; do rm -f $i; done; \
1228
)
1329

1430
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
1531

16-
# throw errors if Gemfile has been modified since Gemfile.lock
17-
RUN bundle config --global frozen 1
18-
RUN bundle config set deployment 'true'
19-
20-
RUN mkdir -p /app
21-
WORKDIR /app
22-
23-
COPY Gemfile /app
24-
COPY Gemfile.lock /app
25-
26-
RUN gem install bundler -v '2.3.6'
27-
RUN bundle config set without 'development test'
28-
RUN bundler install --verbose --retry=3
29-
RUN gem install --user-install executable-hooks
30-
3132
COPY . /app
3233

33-
RUN bundle config set frozen true
34-
CMD ./script/server-buildpacks
34+
CMD ["./script/server-buildpacks"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ DOCKER ?= docker
2727

2828
.PHONY: docker-build
2929
docker-build:
30-
$(DOCKER) build -t $(DOCKER_DEST) .
30+
$(DOCKER) build --no-cache --pull -t $(DOCKER_DEST) .
3131

3232
.PHONY: docker-login
3333
docker-login:

0 commit comments

Comments
 (0)