Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend-MECRED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MECRED
Frontend-MECRED
Commits
fb1b41a0
Commit
fb1b41a0
authored
1 year ago
by
RichardHeise
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#47
: HOTFIX docker now works
parent
38839dd5
No related branches found
No related tags found
1 merge request
!37
Issue #47: HOTFIX docker now works
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.dockerignore
+0
-0
0 additions, 0 deletions
.dockerignore
Dockerfile
+11
-19
11 additions, 19 deletions
Dockerfile
docker-compose.yaml
+4
-6
4 additions, 6 deletions
docker-compose.yaml
with
15 additions
and
25 deletions
.docker
e
ignore
→
.dockerignore
+
0
−
0
View file @
fb1b41a0
File moved
This diff is collapsed.
Click to expand it.
Dockerfile
+
11
−
19
View file @
fb1b41a0
FROM
node:21-bookworm
AS
base
FROM
node:21-bookworm
AS
base
# -------------------------------------------------------------------------------------- #
# Install dependencies only when needed
# Install dependencies only when needed
FROM
base
AS
deps
FROM
base
AS
deps
RUN
apt
install
--no-install-recommends
libc6
RUN
apt
-get
install
--no-install-recommends
libc6
WORKDIR
/app
WORKDIR
/app
# Install dependencies based on the preferred package manager
# Install dependencies based on the preferred package manager
...
@@ -15,11 +16,12 @@ RUN \
...
@@ -15,11 +16,12 @@ RUN \
fi
fi
# -------------------------------------------------------------------------------------- #
# Rebuild the source code only when needed
# Rebuild the source code only when needed
FROM
base
AS
builder
FROM
base
AS
builder
WORKDIR
/app
WORKDIR
/app
COPY
--from=deps /app/node_modules
.
/node_modules
COPY
--from=deps /app/node_modules
/app
/node_modules
COPY
.
.
COPY
.
/app
# Next.js collects completely anonymous telemetry data about general usage.
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Learn more here: https://nextjs.org/telemetry
...
@@ -33,6 +35,7 @@ RUN \
...
@@ -33,6 +35,7 @@ RUN \
else
echo
"Lockfile not found."
&&
exit
1
;
\
else
echo
"Lockfile not found."
&&
exit
1
;
\
fi
fi
# -------------------------------------------------------------------------------------- #
# Production image, copy all the files and run next
# Production image, copy all the files and run next
FROM
base
AS
runner
FROM
base
AS
runner
WORKDIR
/app
WORKDIR
/app
...
@@ -41,28 +44,17 @@ ENV NODE_ENV production
...
@@ -41,28 +44,17 @@ ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV
NEXT_TELEMETRY_DISABLED 1
ENV
NEXT_TELEMETRY_DISABLED 1
RUN
addgroup
--system
--gid
1001 nodejs
COPY
--from=builder /app/ /app/
RUN
adduser
--system
--uid
1001 nextjs
COPY
--from=builder /app/public ./public
RUN
groupadd
--gid
1001 nodejs
&&
useradd
--uid
1001
--gid
nodejs
--shell
/bin/bash
--create-home
nextjs
# Set the correct permission for prerender cache
RUN
chown
nextjs:nodejs /app/.next
RUN
mkdir
.next
RUN
chown
nextjs:nodejs .next
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
# We have to remove this lines so npm start will work
# COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
# COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER
nextjs
USER
nextjs
WORKDIR
/app
EXPOSE
3000
ENV
PORT 3000
ENV
PORT 3000
# set hostname to localhost
EXPOSE
3000
ENV
HOSTNAME "0.0.0.0"
# server.js is created by next build from the standalone output
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yaml
+
4
−
6
View file @
fb1b41a0
version
:
'
3.5'
services
:
services
:
app
:
mecred
:
container_name
:
mecred-frontend
build
:
build
:
context
:
.
context
:
.
dockerfile
:
Dockerfile
dockerfile
:
Dockerfile
container_name
:
frontend-mecred
ports
:
ports
:
-
'
3000:3000'
-
'
3000:3000'
volumes
:
volumes
:
-
.:/app
-
./public/:/app/public/
-
./src/:/app/src/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment