Unverified Commit f14a3a7c authored by John Malconian's avatar John Malconian Committed by GitHub

Merge pull request #73 from folio-org/folio-1993-dockerfile

add dockerfile for serving stripes
parents e244ac2a e34fb572
......@@ -103,6 +103,19 @@ Example running "new_user" test in `ui-users`:
$ yarn test-regression --run users:new_user
```
## Build stripes using the Dockerfile
The included Dockerfile allows for building a container that serves the stripes platform using Nginx. Pass in the Okapi URL and tenant ID as build arguments. The defaults are shown below:
```
docker build -f docker/Dockerfile \
--build-arg OKAPI_URL=http://localhost:9130 \
--build-arg TENANT=diku -t stripes .
```
The nginx server name can be passed to the container at runtime. The defualt value is `localhost` if no argument as passed. For example, to have nginx use `127.0.0.1` as the server name:
```
docker run stripes 127.0.0.1
```
## Additional information
See project [FOLIO](https://issues.folio.org/browse/FOLIO)
......
node_modules
\ No newline at end of file
FROM node:8.16-alpine as stripes_build
ARG OKAPI_URL=http://localhost:9130
ARG TENANT_ID=diku
RUN mkdir -p /etc/folio/stripes
WORKDIR /etc/folio/stripes
COPY . /etc/folio/stripes/
RUN yarn config set @folio:registry https://repository.folio.org/repository/npm-folioci/
RUN yarn install
RUN yarn build-module-descriptors
RUN yarn build output --okapi $OKAPI_URL --tenant $TENANT_ID
# nginx stage
FROM nginx:stable-alpine
EXPOSE 80
COPY --from=stripes_build /etc/folio/stripes/output /usr/share/nginx/html
COPY --from=stripes_build /etc/folio/stripes/yarn.lock /usr/share/nginx/html/yarn.lock
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY docker/entrypoint.sh /usr/bin/entrypoint.sh
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
#!/bin/sh
SERVER_NAME=${1:-localhost}
sed -i "s|localhost|$SERVER_NAME|" /etc/nginx/conf.d/default.conf
/usr/sbin/nginx -g 'daemon off;'
server {
listen 80;
server_name localhost;
charset utf-8;
# Serve index.html for any request not found
location / {
# Set path
root /usr/share/nginx/html;
include mime.types;
types {
text/plain lock;
}
try_files $uri /index.html;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment