Skip to content

Commit e075160

Browse files
authored
Merge pull request #41 from keepsimpleio/dev
Fix: Login Issue
2 parents 01a3565 + 01121fb commit e075160

3 files changed

Lines changed: 35 additions & 19 deletions

File tree

Dockerfile

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
1-
FROM node:20.19.0 AS base
1+
FROM node:20.19.0-alpine AS deps
2+
23
WORKDIR /app
34

4-
FROM base AS deps
5-
COPY package.json yarn.lock ./
6-
RUN yarn install --frozen-lockfile
5+
# Install dependencies (use lockfile if present for reproducible builds)
6+
COPY package.json yarn.lock* ./
7+
RUN if [ -f yarn.lock ]; then yarn install --frozen-lockfile; else yarn install; fi
78

8-
FROM base AS builder
9-
COPY --from=deps /app/node_modules ./node_modules
10-
COPY . .
11-
RUN yarn run build
9+
FROM node:20.19.0-alpine AS builder
1210

13-
FROM base AS runner
11+
WORKDIR /app
1412
ENV NODE_ENV=production
13+
14+
COPY . .
15+
COPY --from=deps /app/node_modules ./node_modules
16+
17+
RUN yarn run build:staging
18+
19+
FROM node:20.19.0-alpine AS runner
20+
1521
WORKDIR /app
16-
COPY --from=builder /app/package.json ./package.json
17-
COPY --from=builder /app/next.config.js ./next.config.js
22+
ENV NODE_ENV=production
23+
ENV NEXT_TELEMETRY_DISABLED=1
24+
ENV PORT=3005
25+
26+
# Copy only the minimal standalone output
1827
COPY --from=builder /app/public ./public
19-
COPY --from=builder /app/.next ./.next
20-
COPY --from=builder /app/node_modules ./node_modules
28+
COPY --from=builder /app/.next/standalone ./
29+
COPY --from=builder /app/.next/static ./.next/static
30+
COPY --from=builder /app/.env ./.env
31+
2132
EXPOSE 3005
22-
CMD ["yarn", "run", "start:staging"]
33+
34+
CMD ["node", "server.js"]
35+

docker-compose.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
services:
2-
web:
3-
build: .
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
46
ports:
57
- "3005:3005"
8+
environment:
9+
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
10+
- NEXTAUTH_URL=${NEXTAUTH_URL}

next.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = async () => {
2020
defaultLocale: 'en',
2121
},
2222
assetPrefix: isLocal ? '' : '/uxcore_next',
23+
output: 'standalone',
2324
async rewrites() {
2425
return [
2526
{
@@ -47,9 +48,6 @@ module.exports = async () => {
4748
experimental: {
4849
manualClientBasePath: true,
4950
},
50-
env: {
51-
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
52-
},
5351
compiler: {
5452
removeConsole:
5553
process.env.NODE_ENV === 'prod' ? { exclude: ['error'] } : false,

0 commit comments

Comments
 (0)