Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Apodemus Erectus | a46bc9ab05 | |
Apodemus Erectus | 50d368aacf | |
Apodemus Erectus | 8cade98186 |
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
"**/node_modules": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
# Use an official Ruby runtime as a parent image
|
||||
FROM ruby:2.7.5-buster
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
ENV PUMA="gem wrappers show pumactl"
|
||||
ENV RAILS_ENV=test
|
||||
|
||||
RUN apt-get update || true
|
||||
|
||||
RUN apt-get install -y \
|
||||
build-essential \
|
||||
nodejs \
|
||||
yarn && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install gems
|
||||
|
||||
# COPY Gemfile Gemfile.lock Rakefile ./
|
||||
COPY . .
|
||||
|
||||
RUN gem install rake bundler && \
|
||||
# bundle config set --local path 'vendor' && \
|
||||
bundle install && \
|
||||
bundle update && \
|
||||
bundle install
|
||||
# bundle binstubs --all
|
||||
|
||||
RUN rails db:migrate
|
||||
|
||||
RUN rails app:update:bin && \
|
||||
rails credentials:edit
|
||||
|
||||
RUN rails assets:precompile && \
|
||||
rails webpacker:install
|
||||
|
||||
# RUN rake test
|
||||
|
||||
RUN bash -c "cat > /etc/systemd/system/ingang.service" << EOF \
|
||||
[Unit] \
|
||||
Description=Ingang \
|
||||
\
|
||||
[Service] \
|
||||
Type=simple \
|
||||
RemainAfterExit=yes \
|
||||
Restart=on-failure \
|
||||
TimeoutSec=300 \
|
||||
User=$USER \
|
||||
WorkingDirectory=$PWD \
|
||||
PIDFile=$PWD/tmp/pids/server.pid \
|
||||
ExecStart=$PUMA -F $PWD/config/puma.rb start \
|
||||
ExecStop=$PUMA -F $PWD/config/puma.rb stop \
|
||||
ExecReload=$PUMA -F $PWD/config/puma.rb phased-restart \
|
||||
\
|
||||
[Install] \
|
||||
WantedBy=multi-user.target \
|
||||
EOF
|
||||
|
||||
RUN chkconfig ingang --add && \
|
||||
service ingang stop && \
|
||||
service ingang off && \
|
||||
service ingang on && \
|
||||
service ingang start && \
|
||||
service ingang status && \
|
||||
journalctl -u ingang
|
||||
|
||||
# Copy the application code
|
||||
# COPY . .
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 6969
|
||||
|
||||
# Set the entrypoint command
|
||||
# CMD ["rails", "server", "-b", "0.0.0.0"]
|
|
@ -0,0 +1,7 @@
|
|||
version: "3"
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
command: bundle exec rails s -p 6969 -b '0.0.0.0'
|
||||
ports:
|
||||
- "6969:6969"
|
Loading…
Reference in New Issue