-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow env vars to be set when deploying the site. Fix 183
Instead of baking the pre-built site in the Docker image, the site has to be built when spinning up a Docker container
- Loading branch information
1 parent
aa9efcc
commit 2ab5416
Showing
10 changed files
with
2,889 additions
and
2,052 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
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,25 @@ | ||
#!/usr/bin/env bash | ||
set -e # halt script on error | ||
|
||
# This scripts builds the site and moves it to the Nginx folder. | ||
# To be run as a command in docker-compose | ||
|
||
# Build the site | ||
if [[ $DS_ENV == 'offline' ]]; then | ||
echo 'Building version for offline use' | ||
yarn build-offline | ||
else | ||
echo 'Building production version' | ||
yarn build | ||
fi | ||
|
||
# Clean default nginx content | ||
rm -r /usr/share/nginx/html/* | ||
mv ./dist/* /usr/share/nginx/html | ||
|
||
# Make sure nginx stays up once the container is done | ||
echo "daemon off;" >> /etc/nginx/nginx.conf || true | ||
|
||
# Start nginx | ||
nginx | ||
|
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,6 @@ | ||
.git | ||
.tmp | ||
.eslintrc | ||
.travis.yml | ||
.gitignore | ||
.gitattributes |
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 +1 @@ | ||
6 | ||
8 |
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
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,2 +1,12 @@ | ||
FROM nginx:alpine | ||
COPY dist /usr/share/nginx/html | ||
# https://github.com/ExiaSR/alpine-yarn-nginx | ||
FROM exiasr/alpine-yarn-nginx | ||
|
||
# Add build dependencies | ||
RUN apk add --no-cache make gcc g++ python | ||
|
||
ADD . /source | ||
WORKDIR /source | ||
RUN yarn install | ||
|
||
# Remove them to keep image size small | ||
RUN apk del make gcc g++ python |
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
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
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
Oops, something went wrong.