mirror of
https://github.com/Viren070/docker-compose-template.git
synced 2025-12-01 23:17:00 +01:00
d61965d1f0
Updated the Dockerfile to copy built files from the 'dist' directory instead of 'public' and 'adapters'.
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
services:
|
|
syncribullet:
|
|
image: syncribullet
|
|
container_name: syncribullet
|
|
restart: unless-stopped
|
|
build:
|
|
context: https://github.com/aliyss/syncribullet.git
|
|
dockerfile_inline: |
|
|
FROM node:20.19-alpine AS builder
|
|
WORKDIR /build
|
|
|
|
COPY package*.json .
|
|
RUN npm ci
|
|
|
|
COPY adapters ./adapters
|
|
COPY public ./public
|
|
COPY src ./src
|
|
COPY .eslintrc.cjs tsconfig.json vite.config.ts .
|
|
|
|
RUN npm run build
|
|
|
|
FROM node:20.19-alpine AS runtime
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /build/package*.json ./
|
|
RUN npm ci --ignore-scripts --only=production && npm cache clean --force
|
|
|
|
# Copy built files from the builder stage
|
|
COPY --from=builder /build/dist ./dist
|
|
COPY --from=builder /build/server ./server
|
|
COPY --from=builder /build/node_modules ./node_modules
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
CMD ["node", "server/entry.express"]
|
|
expose:
|
|
- 3000
|
|
env_file:
|
|
- .env
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.syncribullet.rule=Host(`${SYNCRIBULLET_HOSTNAME?}`)"
|
|
- "traefik.http.routers.syncribullet.entrypoints=websecure"
|
|
- "traefik.http.routers.syncribullet.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.syncribullet.loadbalancer.server.port=3000"
|
|
- "traefik.http.routers.syncribullet.middlewares=authelia@docker"
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"wget",
|
|
"--quiet",
|
|
"--tries=1",
|
|
"--spider",
|
|
"http://localhost:3000/manifest.json",
|
|
]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
profiles:
|
|
- syncribullet
|
|
- all
|