-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (23 loc) · 856 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
FROM ruby:3.2.3-alpine3.19 as build
COPY . /app
WORKDIR /app
RUN apk update && apk upgrade --no-cache \
&& apk add --no-cache libpq-dev build-base git bash tzdata gcompat gcc g++ postgresql \
&& gem install rails railties bundler \
&& bundle install --jobs 2 --no-cache \
&& bundle exec bootsnap precompile
FROM ruby:3.2.3-alpine3.19 as application
LABEL maintainer="Fabiano Santos Florentino"
LABEL version="0.1"
LABEL description="Docker image for Ruby on Rails development"
LABEL appname="Black Pearl"
ENV PATH="/usr/local/bundle/bin:${PATH}"
ENV RUBY_YJIT_ENABLE=1
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY . /app
RUN apk update && apk upgrade --no-cache \
&& apk add --no-cache gcompat postgresql \
&& rm -rf /var/cache/apk/*
WORKDIR /app
EXPOSE 3000
CMD ["sh", "-c", "bundle exec rails s -b 0.0.0.0 -p 3000"]