This repository has been archived by the owner on Apr 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
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 #135 from IBM-Cloud/docker
Docker image for knative
- Loading branch information
Showing
3 changed files
with
26 additions
and
9 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 |
---|---|---|
@@ -1,18 +1,24 @@ | ||
# build | ||
FROM nginx:stable-alpine | ||
# similar to Dockerfile, but uses Apache HTTPd and does not use multi-stage build | ||
FROM httpd:2.4 | ||
|
||
ARG CONTROLLER_SERVICE=http://lw-controller:8080 | ||
ENV CONTROLLER_SERVICE="${CONTROLLER_SERVICE}" | ||
RUN echo "Using ${CONTROLLER_SERVICE}" | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN apk add --no-cache --virtual .build-deps nodejs alpine-sdk python \ | ||
RUN apt-get update \ | ||
&& apt-get install -y curl gnupg \ | ||
&& (curl -sL https://deb.nodesource.com/setup_8.x | bash -) \ | ||
&& apt-get update \ | ||
&& apt-get install -y python build-essential nodejs \ | ||
&& npm install \ | ||
&& npm run deploy:prod \ | ||
&& apk del .build-deps | ||
&& rm -rf node_modules \ | ||
&& mv -f /app/dist/* /usr/local/apache2/htdocs/ \ | ||
&& apt-get remove -y python build-essential nodejs curl | ||
|
||
RUN cp /app/dist/docker-nginx.conf /etc/nginx/conf.d/default.conf | ||
RUN mv /app/dist/ /var/www/ | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
# Listen on 8080 | ||
RUN sed -i "s/Listen 80/Listen 8080/g" /usr/local/apache2/conf/httpd.conf | ||
EXPOSE 8080 |
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,11 @@ | ||
<IfModule mod_rewrite.c> | ||
|
||
RewriteEngine On | ||
RewriteBase / | ||
RewriteRule ^index\.html$ - [L] | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteCond %{REQUEST_FILENAME} !-l | ||
RewriteRule . /index.html [L] | ||
|
||
</IfModule> |
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