feat: tidy docker setup

Tidy the docker setup and include a Github Action
for publishing docker containers to DockerHub and
Github Container Registry.

Also add a small README file with docker hosting instructions.
This commit is contained in:
Mythie
2024-03-06 15:46:51 +11:00
parent 927cb1a934
commit 2cce6dc2e5
13 changed files with 290 additions and 92 deletions

View File

@@ -32,6 +32,7 @@ RUN apk add --no-cache libc6-compat
RUN apk add --no-cache jq
# Required for node_modules/aws-crt
RUN apk add --no-cache make cmake g++
WORKDIR /app
# Disable husky from installing hooks
@@ -80,6 +81,7 @@ WORKDIR /app
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
COPY --from=installer /app/apps/web/next.config.js .
@@ -91,4 +93,7 @@ COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
CMD node apps/web/server.js
# Get the start script from docker/start.sh
COPY --chown=nextjs:nodejs /docker/start.sh .
CMD start.sh