feat(docker): dockerize
This commit is contained in:
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
.nuxt
|
||||
.output
|
||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM node:20-slim AS base
|
||||
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS prod-deps
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||
|
||||
FROM base AS build
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
RUN pnpm run build
|
||||
|
||||
FROM base
|
||||
|
||||
COPY --from=build /app/.output /app/.output
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
simple-qr:
|
||||
build: .
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.simple-qr.rule=Host(`simple-qr.com`)"
|
||||
- "traefik.http.routers.simple-qr.service=simple-qr"
|
||||
- "traefik.http.services.simple-qr.loadbalancer.server.port=3000"
|
||||
- "traefik.http.routers.simple-qr.tls=true"
|
||||
- "traefik.http.routers.simple-qr.tls.certResolver=myresolver"
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
Reference in New Issue
Block a user