diff --git a/.env.sample b/.env.sample index d032024..9aece53 100644 --- a/.env.sample +++ b/.env.sample @@ -13,6 +13,9 @@ POSTGRES_USER=uchu POSTGRES_PASSWORD=uchu POSTGRES_DB=uchu +# Optional sentry setup +# SENTRY_DSN=https://link/to/sentry/dsn + # Docker networking setup, can be left unchanged DATABASE_PORT=5432 REDIS_PORT=6379 diff --git a/README.md b/README.md index 9c79dc1..bebbb1e 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Create a data folder which will store your database files to ensure no loss of d ```bash mkdir pg-data -mkdir redis-data ``` ## Running @@ -45,7 +44,7 @@ docker-compose build docker-compose up -d ``` -This runs Uchu in the background along with Postgres and Redis. You can attach to the `Uchu.Master` shell using: +This runs Uchu in the background along with Postgres. You can attach to the `Uchu.Master` shell using: ```bash docker attach uchudocker_uchu_1 diff --git a/Redis.Dockerfile b/Redis.Dockerfile deleted file mode 100644 index de6cc87..0000000 --- a/Redis.Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM redis:alpine -WORKDIR /redis - -COPY redis.conf /usr/local/etc/redis/redis.conf -COPY redis.sh ./ - -RUN chmod +x redis.sh \ No newline at end of file diff --git a/Uchu b/Uchu index e85c703..92aad54 160000 --- a/Uchu +++ b/Uchu @@ -1 +1 @@ -Subproject commit e85c703180cab6b515a0445d5172e4f246354555 +Subproject commit 92aad5462a1ece68aee3e5ca24caaa7acdf8cbb4 diff --git a/Uchu.Dockerfile b/Uchu.Dockerfile index ddae7b8..21985cf 100644 --- a/Uchu.Dockerfile +++ b/Uchu.Dockerfile @@ -1,14 +1,17 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine -COPY Uchu config.default.xml .env cert.pfx* ./ RUN apk update && apk add --no-cache gettext curl python3 py3-pip -RUN pip install uchu-cli - -RUN set -o allexport && source .env && set +o allexport && envsubst < config.default.xml > config.xml -RUN dotnet build --configuration Release # Adds the uchu cli as a top level command ENV ENV="/root/.ashrc" +RUN pip install uchu-cli RUN echo "alias cli=\"python3 -m uchu-cli\"" > "$ENV" -ENTRYPOINT ["dotnet", "Uchu.Master/bin/Release/netcoreapp3.1/Uchu.Master.dll"] \ No newline at end of file +COPY Uchu . +RUN dotnet build --configuration Release + +# Dynamically build the config file +COPY config.default.xml .env cert.pfx* ./ +RUN set -o allexport && source .env && set +o allexport && envsubst < config.default.xml > config.xml + +ENTRYPOINT ["dotnet", "Uchu.Master/bin/Release/netcoreapp3.1/Uchu.Master.dll"] diff --git a/config.default.xml b/config.default.xml index 90839ba..92b73d2 100644 --- a/config.default.xml +++ b/config.default.xml @@ -1,5 +1,6 @@ + $SENTRY_DSN postgres $POSTGRES_DB @@ -42,10 +43,6 @@ localhost 10000 - - redis - 6379 - diff --git a/docker-compose.yaml b/docker-compose.yaml index 7eb1bce..c73e409 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,27 +17,12 @@ services: # - db # ports: # - ${ADMINER_PORT}:8080 - redis: - build: - context: . - dockerfile: Redis.Dockerfile - env_file: - - .env - image: myredis - privileged: true - command: sh -c "./redis.sh" - volumes: - - ${REDIS_DATA_FOLDER}:/data:rw - expose: - - 6379 - restart: always uchu: build: context: . dockerfile: Uchu.Dockerfile depends_on: - db - - redis env_file: - .env volumes: @@ -58,4 +43,4 @@ services: - ${UCHU_SERVER_PORT}:21836/udp - ${UCHU_AUTH_PORT}:40000/udp tty: true - stdin_open: true \ No newline at end of file + stdin_open: true diff --git a/redis.conf b/redis.conf deleted file mode 100644 index e69de29..0000000 diff --git a/redis.sh b/redis.sh deleted file mode 100644 index 4eed194..0000000 --- a/redis.sh +++ /dev/null @@ -1,8 +0,0 @@ -echo never > /sys/kernel/mm/transparent_hugepage/enabled -echo never > /sys/kernel/mm/transparent_hugepage/defrag - -sysctl -w net.core.somaxconn=512 - -sysctl vm.overcommit_memory=1 - -redis-server /usr/local/etc/redis/redis.conf --bind 0.0.0.0 \ No newline at end of file