diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..73424a6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lint Code + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run linter + # TODO: Change to npm ci when the whole next.js thing is set + run: | + npm i + npm run lint diff --git a/bucket-creation.Dockerfile b/bucket-creation.Dockerfile deleted file mode 100644 index 8d496db..0000000 --- a/bucket-creation.Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM node:20-alpine as base - -# Install dependencies only when needed -FROM base AS deps -# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -RUN apk add --no-cache libc6-compat -WORKDIR /app -COPY package.json package-lock.json ./ -RUN ["npm", "pkg", "delete", "scripts.prepare"] -RUN [ "npm", "ci", "--omit=dev" ] - -FROM base AS bucket-creation -WORKDIR /app -COPY --from=deps /app/node_modules node_modules/ -COPY package.json . -COPY scripts scripts -ENV NODE_ENV=production -USER node -CMD [ "node", "scripts/create-bucket.mjs" ] diff --git a/compose.yaml b/compose.yaml index f9c65e3..9df09fe 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,39 +3,19 @@ version: '3.8' name: mu2mi services: - # web-migration: - # build: - # context: . - # dockerfile: migration.Dockerfile - # target: migration - # container_name: web-migration - # restart: on-failure - # environment: - # - DATABASE_URL=${DATABASE_URL} - # depends_on: - # postgres: - # condition: service_healthy - # network_mode: host - - # bucket-creation: - # build: - # context: . - # dockerfile: bucket-creation.Dockerfile - # target: bucket-creation - # container_name: bucket-creation - # restart: on-failure - # environment: - # - S3_ENDPOINT=${S3_ENDPOINT} - # - S3_PORT=${S3_PORT} - # - S3_USE_SSL=${S3_USE_SSL} - # - S3_ACCESS_KEY=${S3_ACCESS_KEY} - # - S3_SECRET_KEY=${S3_SECRET_KEY} - # - S3_BUCKET_NAME=${S3_BUCKET_NAME} - # - S3_BUCKET_REGION=${S3_BUCKET_REGION} - # depends_on: - # minio: - # condition: service_healthy - # network_mode: host + web-migration: + build: + context: . + dockerfile: migration.Dockerfile + target: migration + container_name: web-migration + restart: on-failure + environment: + - DATABASE_URL=${DATABASE_URL} + depends_on: + postgres: + condition: service_healthy + network_mode: host postgres: image: postgres:16.1-alpine3.19 @@ -43,11 +23,11 @@ services: restart: unless-stopped environment: - PGUSER=postgres - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_PASSWORD=awesomepassword volumes: - postgres-data:/var/lib/postgresql/data ports: - - ${POSTGRES_PORT}:${POSTGRES_PORT} + - '5432:5432' healthcheck: test: ['CMD-SHELL', 'pg_isready'] interval: 1s @@ -62,7 +42,7 @@ services: volumes: - redis-data:/data ports: - - ${REDIS_PORT}:${REDIS_PORT} + - '6379:6379' healthcheck: test: ['CMD', 'redis-cli', 'ping'] interval: 1s @@ -73,13 +53,13 @@ services: image: quay.io/minio/minio:RELEASE.2024-01-18T22-51-28Z container_name: minio restart: unless-stopped - command: server /data --console-address ":${S3_CONSOLE_PORT}" + command: server /data --console-address :9001 environment: - MINIO_ROOT_USER=${S3_ACCESS_KEY} - MINIO_ROOT_PASSWORD=${S3_SECRET_KEY} ports: - - ${INTERNAL_S3_PORT}:${INTERNAL_S3_PORT} - - ${S3_CONSOLE_PORT}:${S3_CONSOLE_PORT} + - 9000:9000 + - 9001:9001 volumes: - minio_data:/data healthcheck: @@ -92,10 +72,8 @@ services: image: minio/mc container_name: bucket-init restart: no - entrypoint: /bin/sh -c "/usr/bin/mc config host add minio http://${INTERNAL_S3_ENDPOINT}:${INTERNAL_S3_PORT} ${S3_ACCESS_KEY} ${S3_SECRET_KEY} && /usr/bin/mc mb minio/${S3_BUCKET_NAME} && /usr/bin/mc anonymous set public minio/${S3_BUCKET_NAME} && exit 0" + entrypoint: /bin/sh -c "/usr/bin/mc config host add minio http://minio:9000 ${S3_ACCESS_KEY} ${S3_SECRET_KEY} && /usr/bin/mc mb minio/${S3_BUCKET_NAME} && /usr/bin/mc anonymous set public minio/${S3_BUCKET_NAME} && exit 0" environment: - - INTERNAL_S3_ENDPOINT=${INTERNAL_S3_ENDPOINT} - - INTERNAL_S3_PORT=${INTERNAL_S3_PORT} - S3_ACCESS_KEY=${S3_ACCESS_KEY} - S3_SECRET_KEY=${S3_SECRET_KEY} - S3_BUCKET_NAME=${S3_BUCKET_NAME} diff --git a/web.Dockerfile b/web.Dockerfile index 2ac0652..1761682 100644 --- a/web.Dockerfile +++ b/web.Dockerfile @@ -23,8 +23,6 @@ COPY . . # Uncomment the following line in case you want to disable telemetry during the build. ENV NEXT_TELEMETRY_DISABLED 1 -ARG ENABLE_ALPINE_PRIVATE_NETWORKING - ARG NEXT_MANUAL_SIG_HANDLE ARG PROTOCOL ARG HOST