Skip to content

Commit

Permalink
fix(docker): ビルドできるように (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid authored Jan 24, 2024
1 parent 6f7a89f commit c1e7802
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
add-hosts: |
ja.osdn.net:127.0.0.1
build-args: |
enable_mecab=1
push: true
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:lts-bullseye
FROM node:lts

RUN apt-get update && apt-get install -y tini
RUN apt-get update && apt-get install tini --no-install-recommends -y && apt-get clean && rm -rf /var/lib/apt-get/lists/*

ARG enable_mecab=1

Expand All @@ -19,7 +19,7 @@ RUN if [ $enable_mecab -ne 0 ]; then apt-get update \
COPY . /ai

WORKDIR /ai
RUN npm install && npm run build
RUN npm install && npm run build || test -f ./built/index.js

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD npm start
2 changes: 1 addition & 1 deletion src/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import config from '@/config.js';
import Module from '@/module.js';
import Message from '@/message.js';
import Friend, { FriendDoc } from '@/friend.js';
import { User } from '@/misskey/user.js';
import type { User } from '@/misskey/user.js';
import Stream from '@/stream.js';
import log from '@/utils/log.js';
import { sleep } from './utils/sleep.js';
Expand Down
2 changes: 1 addition & 1 deletion src/friend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { bindThis } from '@/decorators.js';
import from '@/ai.js';
import IModule from '@/module.js';
import getDate from '@/utils/get-date.js';
import { User } from '@/misskey/user.js';
import type { User } from '@/misskey/user.js';
import { genItem } from '@/vocabulary.js';

export type FriendDoc = {
Expand Down
2 changes: 1 addition & 1 deletion src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import chalk from 'chalk';

import from '@/ai.js';
import Friend from '@/friend.js';
import { User } from '@/misskey/user.js';
import type { User } from '@/misskey/user.js';
import includes from '@/utils/includes.js';
import or from '@/utils/or.js';
import config from '@/config.js';
Expand Down
4 changes: 2 additions & 2 deletions src/modules/emoji-react/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { bindThis } from '@/decorators.js';
import { parse } from 'twemoji-parser';

import { Note } from '@/misskey/note.js';
import type { Note } from '@/misskey/note.js';
import Module from '@/module.js';
import Stream from '@/stream.js';
import includes from '@/utils/includes.js';
import { sleep } from '../../utils/sleep.js';
import { sleep } from '@/utils/sleep.js';

export default class extends Module {
public readonly name = 'emoji-react';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/kazutori/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import loki from 'lokijs';
import Module from '@/module.js';
import Message from '@/message.js';
import serifs from '@/serifs.js';
import { User } from '@/misskey/user.js';
import type { User } from '@/misskey/user.js';
import { acct } from '@/utils/acct.js';

type Game = {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/poll/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Module from '@/module.js';
import serifs from '@/serifs.js';
import { genItem } from '@/vocabulary.js';
import config from '@/config.js';
import { Note } from '@/misskey/note.js';
import type { Note } from '@/misskey/note.js';

export default class extends Module {
public readonly name = 'poll';
Expand Down
4 changes: 2 additions & 2 deletions src/modules/reversi/back.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import got from 'got';
import * as Reversi from './engine.js';
import config from '@/config.js';
import serifs from '@/serifs.js';
import { User } from '@/misskey/user.js';
import type { User } from '@/misskey/user.js';

function getUserName(user) {
return user.name || user.username;
Expand Down Expand Up @@ -263,7 +263,7 @@ class Session {
}
break;
}

default:
break;
}
Expand Down

0 comments on commit c1e7802

Please sign in to comment.