Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58311ba2df | |||
| 410f72caf0 | |||
| f0e2c60620 | |||
| ae0502ce16 | |||
| 3378d5c523 | |||
| b7c4df42e0 | |||
| a8ef158fd7 | |||
| 52e45a663e | |||
| 0c3ffff81c | |||
| 98c60c0d27 | |||
| b20b33bf9b | |||
| ad21d7fb6a |
+6
-6
@@ -39,26 +39,26 @@ ENV NODE_ENV=production
|
|||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
openssl \
|
openssl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
&& groupadd --system --gid 1001 nodejs \
|
||||||
|
&& useradd --system --uid 1001 nextjs
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
COPY --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||||
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
|
|
||||||
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
|
|
||||||
|
|
||||||
COPY --from=builder /app/prisma/schema.prisma /app/schema.prisma
|
COPY --from=builder /app/prisma/schema.prisma /app/schema.prisma
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
ENV DATABASE_URL="file:/app/data/dev.db"
|
ENV DATABASE_URL="file:./data/dev.db"
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -85,13 +85,13 @@ services:
|
|||||||
- "traefik.http.routers.${NAME_SERVICE}.rule=Host(`recall.vodorod.cl`)"
|
- "traefik.http.routers.${NAME_SERVICE}.rule=Host(`recall.vodorod.cl`)"
|
||||||
environment:
|
environment:
|
||||||
- TZ=America/Santiago
|
- TZ=America/Santiago
|
||||||
- DATABASE_URL=file:/app/data/dev.db
|
- DATABASE_URL=file:./data/dev.db
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
networks:
|
networks:
|
||||||
- homelab-net
|
- homelab-net
|
||||||
mem_limit: 512m
|
mem_limit: 32m
|
||||||
mem_reservation: 256m
|
mem_reservation: 16m
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
homelab-net:
|
homelab-net:
|
||||||
|
|||||||
@@ -248,7 +248,3 @@ src/
|
|||||||
└── types/
|
└── types/
|
||||||
└── note.ts
|
└── note.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
nueva prueba
|
|
||||||
BIN
Binary file not shown.
+1
-1
@@ -8,5 +8,5 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=file:/app/data/dev.db
|
- DATABASE_URL=file:./data/dev.db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
+4
-15
@@ -1,25 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd /app
|
# Initialize database if it doesn't exist or schema changed
|
||||||
|
|
||||||
echo "Checking database..."
|
echo "Checking database..."
|
||||||
|
|
||||||
# Ensure data directory exists with proper permissions
|
# Create data directory if it doesn't exist
|
||||||
mkdir -p /app/data
|
mkdir -p /app/data
|
||||||
chmod 777 /app/data
|
|
||||||
|
|
||||||
# Run db push (creates/updates database schema)
|
# Push schema (safe - won't overwrite data, only syncs schema)
|
||||||
# If it fails due to OOM but DB exists, continue anyway
|
npx prisma db push --skip-generate --skip-pull
|
||||||
./node_modules/prisma/build/index.js db push --skip-generate || {
|
|
||||||
exit_code=$?
|
|
||||||
if [ -f /app/data/dev.db ]; then
|
|
||||||
echo "db push failed (code $exit_code) but database exists, continuing..."
|
|
||||||
else
|
|
||||||
echo "db push failed and database does not exist"
|
|
||||||
exit $exit_code
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Starting application..."
|
echo "Starting application..."
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user