diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish.yml similarity index 85% rename from .github/workflows/publish-dev.yml rename to .github/workflows/publish.yml index 0580ecf..7a13572 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,11 @@ ---- name: Docker Publish on: push: - paths: - - "Dockerfile.dev" - branches: - - main + # branches: + # - main + schedule: + - cron: "40 2 2 * *" + workflow_dispatch: jobs: buildDockerImage: name: Build Docker image @@ -25,7 +25,7 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: ghcr.io/AreaFiftyLAN/lan-dev + images: ghcr.io/AreaFiftyLAN/areafiftylan tags: | type=sha, prefix={{date 'X'}}- latest @@ -34,5 +34,4 @@ jobs: with: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - file: Dockerfile.dev push: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a323dc9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +# Use the NodeJS image as builder +FROM node:lts AS builder + +# Create the workspace +WORKDIR /usr/src/app + +# Copy over the package, and install the dependencies +COPY package.json . +RUN yarn + +# Copy over the other files. +COPY components ./components +COPY layouts ./layouts +COPY pages ./pages +COPY public ./public +COPY server ./public +COPY app.vue . +COPY nuxt.config.ts . +COPY tsconfig.json . + +# Build the application +RUN yarn build + +# The actual server, this builds the final image +FROM node:lts + +# Create the workspace +WORKDIR /usr/src/app + +# Copy the output of the builder +COPY --from=builder /usr/src/app/.output ./.output + +# Start +ENV HOST 0.0.0.0 +ENV PORT 80 +EXPOSE 80 +CMD node .output/server/index.mjs diff --git a/package.json b/package.json index af55c8e..6e99402 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "private": true, "scripts": { "dev": "nuxt dev --no-clear", - "build": "nuxt build --prerender", + "build": "nuxt build", "serve": "yarn build && nuxt preview", "typecheck": "nuxt typecheck", "lint": "eslint . --ext .ts,.js,.vue,.json --max-warnings 0"