Skip to content

Commit d6fd431

Browse files
authored
Merge pull request #1120 from amvanbaren/docker-deployment
Add docker deployment
2 parents fb146a2 + d62c161 commit d6fd431

File tree

14 files changed

+206
-8
lines changed

14 files changed

+206
-8
lines changed

.devfile.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ commands:
133133
exec:
134134
label: "2.1. Build and Publish OpenVSX Image"
135135
component: tool
136-
workingDir: ${PROJECTS_ROOT}/openvsx/openshift
136+
workingDir: ${PROJECTS_ROOT}/openvsx/deploy/openshift
137137
commandLine: |
138138
read -p "Please enter the value for OPENVSX_VERSION (default: v0.18.0): " OPENVSX_VERSION
139139
OPENVSX_VERSION=${OPENVSX_VERSION:-v0.18.0}
@@ -150,7 +150,7 @@ commands:
150150
exec:
151151
label: "2.2. Build and Publish OpenVSX CLI Image"
152152
component: tool
153-
workingDir: ${PROJECTS_ROOT}/openvsx/openshift
153+
workingDir: ${PROJECTS_ROOT}/openvsx/deploy/openshift
154154
commandLine: |
155155
podman build -t "openvsx-cli" -f cli.Dockerfile .&&
156156
export IMAGE=image-registry.openshift-image-registry.svc:5000/$OPENVSX_NAMESPACE/openvsx-cli &&
@@ -162,7 +162,7 @@ commands:
162162
exec:
163163
label: "2.3. Deploy OpenVSX"
164164
component: tool
165-
workingDir: ${PROJECTS_ROOT}/openvsx/openshift
165+
workingDir: ${PROJECTS_ROOT}/openvsx/deploy/openshift
166166
commandLine: |
167167
oc process -f openvsx-deployment.yml \
168168
-p OPENVSX_SERVER_IMAGE=image-registry.openshift-image-registry.svc:5000/$OPENVSX_NAMESPACE/openvsx \
@@ -190,7 +190,7 @@ commands:
190190
exec:
191191
label: "2.5. Configure Che to use the internal OpenVSX registry"
192192
component: tool
193-
workingDir: ${PROJECTS_ROOT}/openvsx/openshift
193+
workingDir: ${PROJECTS_ROOT}/openvsx/deploy/openshift
194194
commandLine: |
195195
export CHECLUSTER_NAME="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.name')" &&
196196
export CHECLUSTER_NAMESPACE="$(kubectl get checluster --all-namespaces -o json | jq -r '.items[0].metadata.namespace')" &&
@@ -221,5 +221,5 @@ commands:
221221
exec:
222222
label: "2.7. Publish list of VS Code Extensions"
223223
component: tool
224-
workingDir: ${PROJECTS_ROOT}/openvsx/openshift
224+
workingDir: ${PROJECTS_ROOT}/openvsx/deploy/openshift
225225
commandLine: ./scripts/publish_extensions.sh

deploy/docker/Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
ARG OPENVSX_VERSION
2+
3+
# Builder image to compile the website
4+
FROM ubuntu AS builder
5+
6+
WORKDIR /workdir
7+
8+
# See https://github.com/nodesource/distributions/blob/main/README.md#debinstall
9+
RUN apt-get update \
10+
&& apt-get install --no-install-recommends -y \
11+
bash \
12+
ca-certificates \
13+
git \
14+
curl \
15+
&& apt-get clean \
16+
&& rm -rf /var/lib/apt/lists/* \
17+
&& curl -sSL https://deb.nodesource.com/setup_20.x | bash - \
18+
&& apt-get install -y nodejs \
19+
&& apt-get clean \
20+
&& corepack enable \
21+
&& corepack prepare yarn@stable --activate
22+
23+
ARG OPENVSX_VERSION
24+
ENV VERSION=$OPENVSX_VERSION
25+
26+
RUN git clone --branch ${VERSION} --depth 1 https://github.com/eclipse/openvsx.git /workdir
27+
COPY ./configuration /workdir/configuration
28+
29+
RUN /usr/bin/yarn --cwd webui \
30+
&& /usr/bin/yarn --cwd webui build \
31+
&& /usr/bin/yarn --cwd webui build:default
32+
33+
34+
# Main image derived from openvsx-server
35+
FROM ghcr.io/eclipse/openvsx-server:${OPENVSX_VERSION}
36+
ARG OPENVSX_VERSION
37+
38+
COPY --from=builder --chown=openvsx:openvsx /workdir/webui/static/ BOOT-INF/classes/static/
39+
COPY --from=builder --chown=openvsx:openvsx /workdir/configuration/application.yml config/
40+
41+
RUN sed -i "s/<OPENVSX_VERSION>/$OPENVSX_VERSION/g" config/application.yml

deploy/docker/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#/bin/bash
2+
3+
export OPENVSX_VERSION=`curl -sSL https://api.github.com/repos/eclipse/openvsx/releases/latest | jq -r ".tag_name"`
4+
sudo docker build -t "openvsx:$OPENVSX_VERSION" --build-arg "OPENVSX_VERSION=$OPENVSX_VERSION" .
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
logging:
2+
pattern:
3+
level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'
4+
5+
server:
6+
port: 8080
7+
jetty:
8+
threads:
9+
max-queue-capacity: 100
10+
11+
spring:
12+
application:
13+
name: openvsx-server
14+
autoconfigure:
15+
# don't send traces to Zipkin in development
16+
exclude: org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration
17+
profiles:
18+
include: ovsx
19+
cache:
20+
jcache:
21+
config: classpath:ehcache.xml
22+
datasource:
23+
url: jdbc:postgresql://localhost:5432/openvsx
24+
username: openvsx
25+
password: openvsx
26+
flyway:
27+
baseline-on-migrate: true
28+
baseline-version: 0.1.0
29+
baseline-description: JobRunr tables
30+
jpa:
31+
open-in-view: false
32+
properties:
33+
hibernate:
34+
dialect: org.hibernate.dialect.PostgreSQLDialect
35+
hibernate:
36+
ddl-auto: none
37+
session:
38+
store-type: jdbc
39+
jdbc:
40+
initialize-schema: never
41+
42+
security:
43+
oauth2:
44+
client:
45+
registration:
46+
github:
47+
client-id: none
48+
client-secret: none
49+
50+
management:
51+
health:
52+
probes:
53+
enabled: true
54+
endpoints:
55+
web:
56+
exposure:
57+
include:
58+
- health
59+
- metrics
60+
- prometheus
61+
metrics:
62+
distribution:
63+
percentiles-histogram:
64+
http:
65+
server:
66+
requests: true
67+
client:
68+
requests: true
69+
70+
springdoc:
71+
model-and-view-allowed: true
72+
swagger-ui:
73+
path: /swagger-ui
74+
docExpansion: list
75+
operationsSorter: alpha
76+
supportedSubmitMethods:
77+
- get
78+
79+
org:
80+
jobrunr:
81+
job-scheduler:
82+
enabled: true
83+
background-job-server:
84+
enabled: true
85+
worker-count: 2
86+
dashboard:
87+
enabled: false
88+
database:
89+
type: sql
90+
miscellaneous:
91+
allow-anonymous-data-usage: false
92+
93+
bucket4j:
94+
enabled: true
95+
filters:
96+
- cache-name: buckets
97+
url: '/api/-/(namespace/create|publish)'
98+
http-response-headers:
99+
Access-Control-Allow-Origin: '*'
100+
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
101+
rate-limits:
102+
- cache-key: getParameter("token")
103+
bandwidths:
104+
- capacity: 15
105+
time: 1
106+
unit: seconds
107+
- cache-name: buckets
108+
url: '/vscode/asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default'
109+
http-response-headers:
110+
Access-Control-Allow-Origin: '*'
111+
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
112+
rate-limits:
113+
- cache-key: getRemoteAddr()
114+
bandwidths:
115+
- capacity: 75
116+
time: 1
117+
unit: seconds
118+
- cache-name: buckets
119+
url: '/vscode/(?!asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default).*|/api/(?!(.*/.*/review(/delete)?)|(-/(namespace/create|publish))).*'
120+
http-response-headers:
121+
Access-Control-Allow-Origin: '*'
122+
Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remaining
123+
rate-limits:
124+
- cache-key: getRemoteAddr()
125+
bandwidths:
126+
- capacity: 15
127+
time: 1
128+
unit: seconds
129+
130+
ovsx:
131+
databasesearch:
132+
enabled: false
133+
elasticsearch:
134+
clear-on-start: true
135+
host: 'localhost:9200'
136+
extension-control:
137+
update-on-start: true
138+
integrity:
139+
key-pair: create # create, renew, delete, 'undefined'
140+
registry:
141+
version: <OPENVSX_VERSION>
142+
storage:
143+
local:
144+
directory: /tmp
File renamed without changes.

0 commit comments

Comments
 (0)