Compare commits

...

3 Commits
main ... docker

Author SHA1 Message Date
Apodemus Erectus a46bc9ab05 still doesn't work 2023-08-15 16:54:24 +02:00
Apodemus Erectus 50d368aacf added more stuff from the readme to the Dockerfile and subsequently commented them out again 2023-08-15 10:42:08 +02:00
Apodemus Erectus 8cade98186 my feeble attempt at creating a working container 2023-08-11 18:08:45 +02:00
3 changed files with 94 additions and 0 deletions

11
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
}
}

76
Dockerfile Normal file
View File

@ -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"]

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
version: "3"
services:
web:
build: .
command: bundle exec rails s -p 6969 -b '0.0.0.0'
ports:
- "6969:6969"