-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from DFE-Digital/display_with_docker
Add a docker container file
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |