Skip to content

Commit

Permalink
Merge pull request #177 from DFE-Digital/display_with_docker
Browse files Browse the repository at this point in the history
Add a docker container file
  • Loading branch information
nickdevdfe committed Jun 19, 2023
2 parents d345269 + 443d79c commit cc3b519
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use the official Ruby 2.7.6 image as the base image
FROM ruby:2.7.6

# Install Node.js and npm
RUN apt-get update && apt-get install -y nodejs npm

# RUN apt-get install -y nodejs npm

# Set the working directory to /app
WORKDIR /app

# Copy the Gemfile and Gemfile.lock into the container
COPY Gemfile Gemfile.lock ./

# Install the required gems
RUN bundle install

# Copy the package.json and package-lock.json into the container
COPY package*.json ./

# Install the required npm packages
RUN npm install

# Copy the rest of the application code into the container
COPY . .

EXPOSE 4567

# Start the application
CMD ["rails", "server", "-b", "0.0.0.0"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# docker-compose.yml

version: '3.7'

services:
web:
build: .
command: bundle exec middleman server
volumes:
- '.:/app'
ports:
- '4567:4567'
# volumes:
# node_modules:

0 comments on commit cc3b519

Please sign in to comment.