-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 778 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM ruby:4.0.1-alpine AS builder
RUN apk add --no-cache build-base
WORKDIR /mqtt-collector
COPY Gemfile* /mqtt-collector/
RUN bundle config --local frozen 1 && \
bundle config --local without 'development test' && \
bundle install -j4 --retry 3 && \
bundle clean --force
FROM ruby:4.0.1-alpine
LABEL maintainer="georg@ledermann.dev"
# Add tzdata to get correct timezone
RUN apk add --no-cache tzdata
# Decrease memory usage
ENV MALLOC_ARENA_MAX=2
# Move build arguments to environment variables
ARG BUILDTIME
ENV BUILDTIME=${BUILDTIME}
ARG VERSION
ENV VERSION=${VERSION}
ARG REVISION
ENV REVISION=${REVISION}
WORKDIR /mqtt-collector
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
COPY . /mqtt-collector/
ENTRYPOINT ["bundle", "exec", "app.rb"]