-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Docker image #631
Open
paroxp
wants to merge
2
commits into
main
Choose a base branch
from
add-docker-image
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Docker image #631
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,2 @@ | ||
node_modules | ||
usage-data-config.json |
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,12 @@ | ||
FROM node:8.12-alpine | ||
|
||
ADD . /app | ||
WORKDIR /app | ||
|
||
ARG COLLECT_USAGE_DATA=true | ||
|
||
RUN npm install | ||
RUN echo "{\"collectUsageData\": $COLLECT_USAGE_DATA}" > usage-data-config.json | ||
|
||
EXPOSE 3000 | ||
CMD ["npm", "start"] |
43 changes: 40 additions & 3 deletions
43
docs/documentation/install/developer-install-instructions.md
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 |
---|---|---|
@@ -1,20 +1,57 @@ | ||
# Instructions for developers | ||
|
||
There are multiple ways of running the application locally. | ||
|
||
## Native | ||
|
||
It's built on the [Express](http://expressjs.com/) framework, and uses [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend). | ||
|
||
## Requirements | ||
### Requirements | ||
|
||
node.js - version 8.x.x | ||
|
||
## Install dependencies | ||
### Install dependencies | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
## Run the kit | ||
### Run the kit | ||
``` | ||
npm start | ||
``` | ||
|
||
Go to [localhost:3000](http://localhost:3000) in your browser. | ||
|
||
## Docker | ||
|
||
You may choose to run the application in the docker environment. Doing so you'd | ||
probably be driven by some of the following: | ||
|
||
- avoid installing/managing node on your machine | ||
- avoid remembering to install/compile dependencies | ||
- running application in an artifact way | ||
- ability to push to Kubernetes (RE Build & Run) or CloudFoundry (GOV.UK PaaS) | ||
- run in _production-like_ environment | ||
|
||
We've placed a `Dockerfile` in the root of the project. | ||
|
||
You can build an image by running the following: | ||
|
||
``` | ||
docker build . -t govuk-prototype-kit:latest | ||
``` | ||
|
||
This step will pull a small image containing a base operating system with node | ||
pre-installed. Additionally, will mount your current working directory along | ||
with installing some `node_modules`. | ||
|
||
You can run it afterwards with: | ||
|
||
``` | ||
docker run -p 3000:3000 govuk-prototype-kit:latest | ||
``` | ||
|
||
The application will listen on your exposed port (`3000` in this case). You | ||
should be able to visit http://localhost:3000/ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should probably be false by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need a default value? Can we ask users the same as normal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because heroku bypasses this we've not run into it before, I ran into this same issue trying to get the kit running in Glitch, maybe there's a way we could timeout the question or have an environment variable, or something else to stop the server from stalling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When pushing an image to the platform, interactive mod isn't a thing. Nor is by default on local environments.
We considered setting this to
false
, however we didn't want to step on your toes too much :)Happy to set it to
false
.