containerisation

Đang mở
#121 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
apache, docker, javascript, node.js
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Start with the proposed Dockerfile, .dockerignore, container/update-httpd-config.sh, and the deployment and development additions to README.md. Check that the documented build and run paths match the files and that both development and production containers can be reproduced. Done means the project builds and runs through both container paths with the documented setup.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

  • Dockerfile
FROM node:14.16.0 as build
RUN mkdir -p /app
WORKDIR /app
COPY . .
RUN npm install && npm run build

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 "*"
</Directory>
<Files "*.*">
  Require all granted
  Header set Access-Control-Allow-Origin "*"
</Files>
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.

Ngôn ngữ chính
JavaScript
Star
120
Fork
18
Merge trung bình
3 phút
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sitespeedio/compare

Tất cả issue của sitespeedio/compare

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.