diff --git a/Dockerfile b/Dockerfile index ba3df5e..3783927 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,7 @@ RUN npm run build FROM node:latest WORKDIR /app -# Add docker-compose-wait tool ------------------- -ENV WAIT_VERSION 2.7.2 -ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait -RUN chmod +x /wait - COPY --from=build /app/.output /app/.output EXPOSE 3000 -CMD [ "sh", "-c", "/wait && node .output/server/index.mjs" ] \ No newline at end of file +CMD [ "node", ".output/server/index.mjs" ] \ No newline at end of file diff --git a/README.md b/README.md index 653771e..b265956 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,8 @@ a Page to view some global statistics about [Modrinth](https://modrinth.com/) ```dotenv # example .env -MONGODB_PORT=27017 -MONGODB_ADMIN_USER=admin -MONGODB_ADMIN_PASSWORD=admin -MONGODB_USER=user -MONGODB_PASSWORD=password +MONGODB_DB=modrinth-statistics +MONGODB_CONNECTION=mongodb://:@:27017/ POSTHOG_API_KEY= POSTHOG_API_HOST=https://eu.posthog.com -``` \ No newline at end of file +``` \ No newline at end of file diff --git a/compose.yml b/compose.yml index 105430f..b412a60 100644 --- a/compose.yml +++ b/compose.yml @@ -4,22 +4,4 @@ services: ports: - "3000:3000" env_file: - - ./.env - environment: - - WAIT_HOSTS=mongodb:27017 - - WAIT_HOSTS_TIMEOUT=300 - - WAIT_SLEEP_INTERVAL=5 - - WAIT_HOST_CONNECT_TIMEOUT=5 - mongodb: - image: mongo - ports: - - ${MONGODB_PORT}:27017 - env_file: - - ./.env - environment: - - MONGO_INITDB_ROOT_USERNAME=${MONGODB_ADMIN_USER} - - MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ADMIN_PASSWORD} - - MONGO_INITDB_DATABASE=stats - volumes: - - ./data:/data/db - - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro + - ./.env \ No newline at end of file diff --git a/mongo-init.js b/mongo-init.js deleted file mode 100644 index 3797a93..0000000 --- a/mongo-init.js +++ /dev/null @@ -1,5 +0,0 @@ -db.createUser({ - user: process.env.MONGODB_USER, - pwd: process.env.MONGODB_PASSWORD, - roles: [{ role: "readWrite", db: "stats" }], -}); diff --git a/nuxt.config.ts b/nuxt.config.ts index 0ef7fed..d4cf9cb 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -16,22 +16,22 @@ export default defineNuxtConfig({ storage: { statistics: { driver: "mongodb", - connectionString: `mongodb://${process.env.MONGODB_USER}:${process.env.MONGODB_PASSWORD}@mongodb:27017/stats`, - databaseName: "stats", + connectionString: `${process.env.MONGODB_CONNECTION}`, + databaseName: `${process.env.MONGODB_DB}`, collectionName: "stats", }, }, devStorage: { - statistics: { - driver: "fs", - base: "./.data/statistics", - }, // statistics: { - // driver: "mongodb", - // connectionString: `mongodb://${process.env.MONGODB_USER}:${process.env.MONGODB_PASSWORD}@tobinio.at:27017/stats`, - // databaseName: "stats", - // collectionName: "stats", + // driver: "fs", + // base: "./.data/statistics", // }, + statistics: { + driver: "mongodb", + connectionString: `${process.env.MONGODB_CONNECTION}`, + databaseName: `${process.env.MONGODB_DB}`, + collectionName: "stats", + }, }, experimental: { tasks: true,