Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.7 docker #12

Merged
merged 5 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .dockerignore

This file was deleted.

3 changes: 3 additions & 0 deletions .fireq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"elastic": 7
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
.python-version
/.project
/.pydevproject
*.pyc
Expand All @@ -19,7 +20,7 @@ env/
bin/
lib/
man/
src/
/server/src/
dist/
node_modules
.settings
Expand Down
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

56 changes: 0 additions & 56 deletions Dockerfile

This file was deleted.

4 changes: 4 additions & 0 deletions client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/node_modules
**/dist
**/package-lock.json
data
25 changes: 25 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# BUILD
FROM node:12 AS build

# install client
WORKDIR /tmp/client
COPY . .
RUN npm install --no-audit --unsafe-perm
RUN npm run build

# DEPLOY
FROM nginx

# setup the environment
WORKDIR /opt/superdesk/client/dist

# build client
COPY --from=build /tmp/client/dist ./

RUN rm /etc/nginx/conf.d/default.conf
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/superdesk_vhost.conf /etc/nginx/sites-enabled/superdesk.conf
COPY ./docker/start.sh /opt/superdesk/start.sh

ENTRYPOINT [ "/opt/superdesk/start.sh" ]
CMD ["nginx", "-g daemon off;"]
4 changes: 1 addition & 3 deletions docker/nginx.conf → client/docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,4 @@ http {

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

daemon off;
}
13 changes: 9 additions & 4 deletions docker/start.sh → client/docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/bash
cd /opt/superdesk/client/dist &&
set -e

cd /opt/superdesk/client/dist

# replace default client config with env vars
sed -i \
-e "s/http:\/\/localhost:5000\/api/$(echo $SUPERDESK_URL | sed 's/\//\\\//g')/g" \
-e "s/ws:\/\/localhost:5100/$(echo $SUPERDESK_WS_URL | sed 's/\//\\\//g')/g" \
-e "s/ws:\/\/0.0.0.0:5100/$(echo $SUPERDESK_WS_URL | sed 's/\//\\\//g')/g" \
-e 's/iframely:{key:""}/iframely:{key:"'$IFRAMELY_KEY'"}/g' \
app*.js &&
nginx &
app*.js

which nginx

cd /opt/superdesk && sleep 5 && bash honcho start
exec "$@"
25 changes: 19 additions & 6 deletions docker/superdesk_vhost.conf → client/docker/superdesk_vhost.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
upstream superdesk_docker {
server localhost:5000;
upstream superdesk_api {
server superdesk-server:5000;
}

upstream superdesk_ws_docker {
server localhost:5100;
upstream superdesk_ws {
server superdesk-server:5100;
}

upstream superdesk_capi {
server superdesk-server:5400;
}

server {
server_name "";

location /ws {
proxy_pass http://superdesk_ws_docker;
proxy_pass http://superdesk_ws;
proxy_http_version 1.1;
proxy_buffering off;
proxy_read_timeout 3600;
Expand All @@ -19,8 +23,17 @@ server {
proxy_set_header Host $host;
}

location /capi {
proxy_pass http://superdesk_capi;
proxy_redirect off;

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api {
proxy_pass http://superdesk_docker;
proxy_pass http://superdesk_api;
proxy_redirect off;

proxy_set_header Host $http_host;
Expand Down
37 changes: 37 additions & 0 deletions client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {startApp} from 'superdesk-core/scripts/index';

setTimeout(() => {
startApp(
[
{
id: 'annotationsLibrary',
load: () => import('superdesk-core/scripts/extensions/annotationsLibrary'),
},
{
id: 'markForUser',
load: () => import('superdesk-core/scripts/extensions/markForUser'),
},
{
id: 'datetimeField',
load: () => import('superdesk-core/scripts/extensions/datetimeField'),
},
{
id: 'planning-extension',
load: () => import('superdesk-planning/client/planning-extension'),
},
{
id: 'broadcasting',
load: () => import('superdesk-core/scripts/extensions/broadcasting').then((broadcasting) => {
broadcasting.setCustomizations({
getRundownItemDisplayName: (rundown) => rundown.technical_title,
});

return broadcasting;
}),
},
],
{},
);
});

export default angular.module('main.superdesk', []);
15 changes: 0 additions & 15 deletions client/index.ts

This file was deleted.

Loading
Loading