-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile.dev
70 lines (54 loc) · 1.74 KB
/
Dockerfile.dev
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM ruby:3.3.1-slim
RUN apt-get update -qq && apt-get install -y build-essential software-properties-common
RUN apt-get update -qq
RUN apt-get install -y nodejs \
libpq-dev \
git \
curl \
libjemalloc2 \
wget \
firefox-esr \
libtool \
automake \
libsodium23
RUN gem install bundler
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.70.0
ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR /var/www/
# We are copying the Gemfile first, so we can install
# all the dependencies without any issues
# Rails will be installed once you load it from the Gemfile
# This will also ensure that gems are cached and only updated when they change.
COPY Gemfile ./
COPY Gemfile.lock ./
COPY package.json yarn.lock .nvmrc ./
RUN NODE_ENV=development
RUN RAILS_ENV=development
# Install the gems.
RUN gem install nokogiri
RUN bundle install --jobs 20
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 20.18.0
ENV NODE_OPTIONS=--openssl-legacy-provider
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN mkdir $NVM_DIR
RUN curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
RUN apt-get install -y python3
RUN npm install -g yarn
RUN yarn cache clean
RUN yarn install --verbose
COPY . .
RUN cd public/creators-landing && yarn install && yarn build
# Now for the NextJS frontend
WORKDIR /var/www//nextjs
RUN npm i
ENV NEXT_TELEMETRY_DISABLED 1
RUN node scripts/copyLeoIcons.js && npm run build
WORKDIR /var/www/
EXPOSE 3000
CMD ["bundle", "exec", "rails","server","-b","0.0.0.0","-p","3000"]