forked from basecamp/fizzy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
39 lines (31 loc) · 1.33 KB
/
Dockerfile.dev
File metadata and controls
39 lines (31 loc) · 1.33 KB
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
37
38
39
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
ARG RUBY_VERSION=3.4.7
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base
# Rails app lives here
WORKDIR /rails
# Set development environment
ENV RAILS_ENV="development" \
BUNDLE_PATH="/usr/local/bundle"
# Install packages needed for development
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl libsqlite3-0 libvips build-essential pkg-config git ffmpeg groff libreoffice-writer libreoffice-impress libreoffice-calc mupdf-tools libyaml-dev libssl-dev sqlite3 && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Install application gems
COPY Gemfile Gemfile.lock .ruby-version ./
COPY lib/fizzy.rb ./lib/fizzy.rb
COPY gems ./gems/
RUN --mount=type=secret,id=GITHUB_TOKEN --mount=type=cache,id=fizzy-devbundle-${RUBY_VERSION},sharing=locked,target=/devbundle \
gem install bundler foreman && \
BUNDLE_PATH=/devbundle BUNDLE_GITHUB__COM="$(cat /run/secrets/GITHUB_TOKEN):x-oauth-basic" bundle install && \
cp -a /devbundle/. "$BUNDLE_PATH"/ && \
bundle clean --force
# Final stage
FROM base
# Entrypoint prepares the database
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
# Start the server by default
EXPOSE 3000
EXPOSE 3006
EXPOSE 5001
CMD ["./bin/thrust", "./bin/rails", "server"]