Skip to content

Commit a407923

Browse files
committed
Get things back to working shape
Update the various frontend scripts to work with rootless Docker (though the ./install.sh script doesn't work since python2 is missing, should be removed) Also, update the webserver to also run in rootless Docker. Everything seems to work, but the UI looks...bad?
1 parent a2468e8 commit a407923

File tree

9 files changed

+510
-41
lines changed

9 files changed

+510
-41
lines changed

.realize.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

go.mod

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ module github.com/bcspragu/Codenames
33
go 1.13
44

55
require (
6+
cloud.google.com/go v0.80.0
67
code.sajari.com/word2vec v1.0.0
7-
github.com/google/go-cmp v0.4.0
8+
github.com/google/go-cmp v0.5.5
89
github.com/gorilla/mux v1.7.3
910
github.com/gorilla/securecookie v1.1.1
1011
github.com/gorilla/websocket v1.4.1
12+
github.com/mattn/go-sqlite3 v1.14.6
13+
github.com/namsral/flag v1.7.4-pre
1114
github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
15+
golang.org/x/net v0.0.0-20210326220855-61e056675ecf
16+
google.golang.org/api v0.43.0
17+
google.golang.org/genproto v0.0.0-20210325224202-eed09b1b5210
1218
)

go.sum

Lines changed: 469 additions & 2 deletions
Large diffs are not rendered by default.

run.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
#/bin/bash
2-
realize start --name="codenames-server"
2+
3+
if ! systemctl is-active --user --quiet docker.service; then
4+
echo "Docker isn't running"
5+
exit 1
6+
fi
7+
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
10+
nsenter \
11+
-U --preserve-credentials -n -m --wd="$DIR" \
12+
-t "$(cat $XDG_RUNTIME_DIR/docker.pid)" \
13+
go run github.com/bcspragu/Codenames/cmd/codenames-server

web/frontend/build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
2+
set -e
3+
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
26
docker run --rm -it \
37
-w /project \
4-
--net=host \
5-
--volume $PWD:/project \
6-
--user $(id -u):$(id -g) \
8+
--mount type=bind,source=$DIR,destination=/project \
79
node:alpine yarn build

web/frontend/dev.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
2+
set -e
3+
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
26
docker run --rm -it \
37
-w /project \
4-
--net=host \
5-
--volume $PWD:/project \
6-
--user $(id -u):$(id -g) \
8+
--mount type=bind,source=$DIR,destination=/project \
79
node:alpine /bin/sh

web/frontend/install.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
2+
set -e
3+
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
26
docker run --rm -it \
37
-w /project \
4-
--net=host \
5-
--volume $PWD:/project \
6-
--user $(id -u):$(id -g) \
8+
--mount type=bind,source=$DIR,destination=/project \
79
node:alpine yarn

web/frontend/serve.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
2+
set -e
3+
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
26
docker run --rm -it \
37
-w /project \
4-
--net=host \
5-
--volume $PWD:/project \
6-
--user $(id -u):$(id -g) \
8+
-p 8081:8081 \
9+
--mount type=bind,source=$DIR,destination=/project \
710
node:alpine yarn serve

web/frontend/vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
port: 8081,
55
proxy: {
66
'/api/': {
7-
target: 'http://localhost:8080',
7+
target: 'http://172.17.0.1:8080',
88
},
99
}
1010
}

0 commit comments

Comments
 (0)