-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (26 loc) · 904 Bytes
/
Dockerfile
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
36
FROM ruby:3.4.1-alpine AS builder
RUN apk add --no-cache build-base
WORKDIR /power-splitter
COPY Gemfile* /power-splitter/
RUN bundle config --local frozen 1 && \
bundle config --local without 'development test' && \
bundle install -j4 --retry 3 && \
bundle clean --force
FROM ruby:3.4.1-alpine
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.description="Distributes imported grid power among individual consumers"
# 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 /power-splitter
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
COPY . /power-splitter/
ENTRYPOINT ["bundle", "exec", "app.rb"]