From ebafed4a97578b519a8f6089cfa0f306666b937f Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 10 Oct 2024 11:16:16 +0200 Subject: [PATCH] server: remove docker support Changelog: Removed --- .config/docker_example.env | 4 -- .dockerignore | 12 ------ .gitignore | 1 - Dockerfile | 36 ---------------- docker-compose.yml | 52 ----------------------- docs/install-docker.md | 85 -------------------------------------- 6 files changed, 190 deletions(-) delete mode 100644 .config/docker_example.env delete mode 100644 .dockerignore delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml delete mode 100644 docs/install-docker.md diff --git a/.config/docker_example.env b/.config/docker_example.env deleted file mode 100644 index 48ea6ece9..000000000 --- a/.config/docker_example.env +++ /dev/null @@ -1,4 +0,0 @@ -# db settings -POSTGRES_PASSWORD=example-foundkey-pass -POSTGRES_USER=example-foundkey-user -POSTGRES_DB=foundkey diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 87b4197df..000000000 --- a/.dockerignore +++ /dev/null @@ -1,12 +0,0 @@ -.autogen -.config -.woodpecker -Dockerfile -build/ -built/ -db/ -docker-compose.yml -elasticsearch/ -node_modules/ -redis/ -files/ diff --git a/.gitignore b/.gitignore index a8a9c09e2..8abc5fa5c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,6 @@ report.*.json # config /.config/* !/.config/example.yml -!/.config/docker_example.env # misskey /build diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index adb010580..000000000 --- a/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM node:18.12.1-alpine3.16 AS base - -ARG NODE_ENV=production - -WORKDIR /foundkey - -ENV BUILD_DEPS autoconf automake file g++ gcc libc-dev libtool make nasm pkgconfig python3 zlib-dev git - -FROM base AS builder - -COPY . ./ - -RUN apk add --no-cache $BUILD_DEPS && \ - git submodule update --init && \ - yarn install && \ - yarn build && \ - rm -rf .git - -FROM base AS runner - -RUN apk add --no-cache \ - ffmpeg \ - tini - -ENTRYPOINT ["/sbin/tini", "--"] - -COPY --from=builder /foundkey/node_modules ./node_modules -COPY --from=builder /foundkey/built ./built -COPY --from=builder /foundkey/packages/backend/node_modules ./packages/backend/node_modules -COPY --from=builder /foundkey/packages/backend/built ./packages/backend/built -COPY --from=builder /foundkey/packages/foundkey-js/built ./packages/foundkey-js/built -COPY . ./ - -ENV NODE_ENV=production -CMD ["npm", "run", "migrateandstart"] - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 3f1264e4f..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: "3" - -services: - web: - build: . - restart: always - links: - - db - - redis -# - es - ports: - - "127.0.0.1:3000:3000" - networks: - - internal_network - - external_network - volumes: - - ./files:/foundkey/files - - ./.config:/foundkey/.config:ro - - redis: - restart: always - image: redis:7.0-alpine - networks: - - internal_network - volumes: - - ./redis:/data - - db: - restart: always - image: postgres:14.5-alpine - networks: - - internal_network - env_file: - - .config/docker.env - volumes: - - ./db:/var/lib/postgresql/data - -# es: -# restart: always -# image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.2 -# environment: -# - "ES_JAVA_OPTS=-Xms512m -Xmx512m" -# - "TAKE_FILE_OWNERSHIP=111" -# networks: -# - internal_network -# volumes: -# - ./elasticsearch:/usr/share/elasticsearch/data - -networks: - internal_network: - internal: true - external_network: diff --git a/docs/install-docker.md b/docs/install-docker.md deleted file mode 100644 index 435b09bd6..000000000 --- a/docs/install-docker.md +++ /dev/null @@ -1,85 +0,0 @@ -# Create FoundKey instance with Docker Compose - -This guide describes how to install and setup FoundKey with Docker Compose. - -**WARNING:** -Never change the domain name (hostname) of an instance once you start using it! - - -## Requirements -- Docker or Podman -- Docker Compose plugin (or podman-compose) - -If using Podman, replace `docker` with `podman`. Commands using `docker compose` should be replaced with `podman-compose`. - -You may need to prefix `docker` commands with `sudo` unless your user is in the `docker` group or you are running Docker in rootless mode. - -## Get the repository -```sh -git clone https://akkoma.dev/FoundKeyGang/FoundKey.git -cd FoundKey -``` - -To make it easier to perform your own changes on top, we suggest making a branch based on the latest tag. -In this example, we'll use `v13.0.0-preview1` as the tag to check out and `my-branch` as the branch name. -```sh -git checkout tags/v13.0.0-preview1 -b my-branch -``` - -## Configure - -Copy example configuration files with following: - -```sh -cp .config/docker_example.yml .config/default.yml -cp .config/docker_example.env .config/docker.env -``` - -Edit `default.yml` and `docker.env` according to the instructions in the files. -You will need to set the database host to `db` and Redis host to `redis` in order to use the internal container network for these services. - -Edit `docker-compose.yml` if necessary. (e.g. if you want to change the port). -If you are using SELinux (eg. you're on Fedora or a RHEL derivative), you'll want to add the `Z` mount flag to the volume mounts to allow the containers to access the contents of those volumes. - -Also check out the [Configure Foundkey](./install.md#configure-foundkey) section in the ordinary installation instructions. - -## Build and initialize -The following command will build FoundKey and initialize the database. -This will take some time. - -``` shell -docker compose build -docker compose run --rm web yarn run init -``` - -## Launch -You can start FoundKey with the following command: - -```sh -docker compose up -d -``` - -In case you are encountering issues, you can run `docker compose logs -f` to get the log output of the running containers. - -## How to update your FoundKey server -When updating, be sure to check the [release notes](https://akkoma.dev/FoundKeyGang/FoundKey/src/branch/main/CHANGELOG.md) to know in advance the changes and whether or not additional work is required (in most cases, it is not). - -To update your branch to the latest tag (in this example `v13.0.0-preview2`), you can do the following: -```sh -git fetch -t - -# Use --squash if you want to merge all of the changes in the tag into a single commit. -# Useful if you have made additional changes. -git merge tags/v13.0.0-preview2 - -# Rebuild and restart the docker container. -docker compose build -docker compose down && docker compose up -d -``` - -It may take some time depending on the contents of the update and the size of the database. - -## How to execute CLI commands -```sh -docker compose run --rm web node packages/backend/built/tools/foo bar -```