-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile.dev
More file actions
38 lines (30 loc) · 909 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
38 lines (30 loc) · 909 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
36
37
38
# syntax=docker/dockerfile:1
# Development Dockerfile for running with docker-compose.dev.yml
# Use with: docker compose -f docker-compose.dev.yml up --build
ARG RUBY_VERSION=3.4.6
FROM docker.io/library/ruby:$RUBY_VERSION-slim
WORKDIR /rails
# Install packages needed for development
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential \
curl \
git \
libyaml-dev \
pkg-config \
nodejs \
npm && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Set development environment
ENV RAILS_ENV="development" \
BUNDLE_PATH="/usr/local/bundle"
# Install gems
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Copy application code
COPY . .
# Build Tailwind CSS
RUN bin/rails tailwindcss:build
# Prepare database and start server
EXPOSE 3000
CMD ["bash", "-c", "bin/rails db:prepare && bin/rails server -b 0.0.0.0"]