Skip to content

Commit 061199b

Browse files
committed
Fix opencode
1 parent 22442c5 commit 061199b

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

docker/opencode/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM ghcr.io/cachix/devenv/devenv
22

33
WORKDIR /home/devenv/opencode
4-
COPY --chown=1000:1000 . .
4+
COPY --chown=1000:1000 devenv.* .
55

66
# Cache the build stuff
7-
RUN devenv shell ls
7+
RUN devenv update && devenv build && devenv shell ls
88

99
ENV OPENCODE_CONFIG=/config/opencode.json
1010
EXPOSE 4096/tcp
1111
ENTRYPOINT [ "devenv", "shell" ]
12-
CMD ["opencode", "web"]
12+
CMD ["opencode", "web", "--port", "4096", "--hostname", "0.0.0.0", "--print-logs"]

docker/opencode/devenv.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
opencode
1616
ripgrep
1717
fd
18+
curl
1819
];
1920

2021
containers."opencode" = {

envs/opencode/main.jsonnet

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ local opencode = dockerService.new('opencode', image, {
2020
TZ: timezone,
2121
OPENCODE_CONFIG: configFile,
2222
XDG_DATA_HOME: dataPath,
23+
OPENCODE_ENABLE_EXA: 'true',
2324
},
2425

25-
// op_envs: { OPENCODE_SERVER_PASSWORD: 'password' },
26+
op_envs: { OPENCODE_SERVER_PASSWORD: 'password' },
2627

2728
pvs: {
2829
[dataPath]: {
@@ -32,7 +33,7 @@ local opencode = dockerService.new('opencode', image, {
3233
},
3334

3435
config_maps: {
35-
'/env/.config/opencode/': 'opencode-config:ro',
36+
'/config': 'opencode-config:ro',
3637
},
3738
});
3839

@@ -43,11 +44,12 @@ local configMap =
4344
'opencode.json': std.manifestJsonEx({
4445
'$schema': 'https://opencode.ai/config.json',
4546
autoupdate: false,
46-
server: {
47-
hostname: '0.0.0.0',
48-
port: 4096,
49-
cors: ['http://opencode.vpn.dzerv.art'],
50-
},
47+
// Unrecognized key for some reason?
48+
// server: {
49+
// port: 4096,
50+
// hostname: '0.0.0.0',
51+
// cors: ['http://opencode.vpn.dzerv.art'],
52+
// },
5153
provider: {
5254
dz: {
5355
models: {
@@ -77,7 +79,7 @@ local configMap =
7779
npm: '@ai-sdk/anthropic',
7880
options: {
7981
apiKey: 'sk-dummy',
80-
baseURL: 'https://ai.vpn.dzerv.art/v1',
82+
baseURL: 'http://cliproxyapi.cliproxyapi.svc:8317/v1',
8183
},
8284
},
8385
},

0 commit comments

Comments
 (0)