Skip to content

Commit

Permalink
fix(nuxt): use ssr temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Nov 21, 2022
1 parent 555920d commit 9da504d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
35 changes: 29 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,39 @@ COPY --from=lint /srv/app/package.json /tmp/lint/package.json
COPY --from=test-integration /srv/app/package.json /tmp/test/package.json


# #######################
# # Provide a web server.

# # Should be the specific version of `nginx:alpine`.
# FROM nginx:1.23.2-alpine@sha256:455c39afebd4d98ef26dd70284aa86e6810b0485af5f4f222b19b89758cabf1e AS production

# WORKDIR /usr/share/nginx/html

# COPY ./nginx.conf /etc/nginx/nginx.conf

# COPY --from=build /srv/app/.output/public/ ./

# HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost/api/healthcheck || exit 1


#######################
# Provide a web server.
# Requires node (cannot be static) as the server acts as backend too.

# Should be the specific version of `node:alpine`.
FROM node:19.1.0-alpine@sha256:3a718461938f351292be2cb77f7299cd4e3d8f28f29d548f0cf3c8551dc80e08 AS production

# Should be the specific version of `nginx:alpine`.
FROM nginx:1.23.2-alpine@sha256:455c39afebd4d98ef26dd70284aa86e6810b0485af5f4f222b19b89758cabf1e AS production
ENV NODE_ENV=production

WORKDIR /usr/share/nginx/html
# Update and install dependencies.
# - `wget` is required by the healthcheck
RUN apk update \
&& apk add --no-cache \
wget

COPY ./nginx.conf /etc/nginx/nginx.conf
WORKDIR /srv/app/

COPY --from=build /srv/app/.output/public/ ./
COPY --from=collect /srv/app/ ./

HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost/api/healthcheck || exit 1
CMD ["node", ".output/server/index.mjs"]
HEALTHCHECK --interval=10s CMD wget -O /dev/null http://localhost:3000/api/healthcheck || exit 1
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"packageManager": "pnpm@7.16.1",
"scripts": {
"dev": "nuxi dev",
"build": "nuxi generate",
"build": "nuxi build",
"start": "node .output/server/index.mjs",
"generate": "nuxi generate",
"cypress:open": "cypress open",
"cypress:test": "cypress run --env type=actual",
"lint": "pnpm lint:js && pnpm lint:ts && pnpm lint:style",
Expand Down

0 comments on commit 9da504d

Please sign in to comment.