forked from clicksign/ruby-dev-test-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
33 lines (23 loc) · 801 Bytes
/
Dockerfile.dev
File metadata and controls
33 lines (23 loc) · 801 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
FROM ruby:3.2.4
WORKDIR /myapp
# Install Node.js and Yarn from NodeSource (correct version)
RUN apt-get update -qq && apt-get install -y curl gnupg2 build-essential libpq-dev zip unzip \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g yarn \
&& rm -rf /var/lib/apt/lists/*
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Add JS build dependencies
RUN yarn add --dev esbuild tailwindcss@^3.3.1
RUN yarn add esbuild-wasm
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build --watch
RUN yarn build:css --watch
EXPOSE 3000
ENV RAILS_ENV=development
ENV RAILS_SERVE_STATIC_FILES=true
ENV RAILS_LOG_TO_STDOUT=true
CMD ["sh", "-c", "rm -f tmp/pids/server.pid && rails server -b 0.0.0.0"]