sitespeedio / compare

Compare HAR files.
https://compare.sitespeed.io
MIT License
111 stars 18 forks source link

containerisation #121

Open LeoK80 opened 3 years ago

LeoK80 commented 3 years ago

Type issue: small improvement / portability

Reason: It could potentially improve portability

Solution: I currently have created a local branch from the repository and added a handful of files aimed at building a simple small apache2 httpd server based container to run the project. The created Dockerfile also provides the option to build/run the development server from a container.

new files:

FROM build AS develop CMD [ "npm", "run", "develop" ]

FROM httpd:2.4 AS production

Configure httpd apache server

COPY container/update-httpd-conf.sh / RUN chmod 750 /update-httpd-conf.sh RUN ["/bin/sh", "/update-httpd-conf.sh"]

COPY --from=build /app/build/ /compare/

- .dockerignore

node_modules build .md .github test/

- container/update-httpd-config.sh

Add configuration to the httpd.conf file

cat >> /usr/local/apache2/conf/httpd.conf <<-EOF DocumentRoot "/compare" LogLevel debug <Directory /compare> Require all granted Header set Access-Control-Allow-Origin "" <Files "."> Require all granted Header set Access-Control-Allow-Origin "" EOF


updated files:
- README.md
sub-section to deploying yourself, describing how to build & run the image/container.
sub-section to developing, describing how to build & run the development image/container.

**Remarks/other:**
I've currently tested my implementation locally as well as having successfully deployed it to a Cloud Foundry platform.