Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoBackendAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Dojo Project (HES-SO)
Projects
Backend
DojoBackendAPI
Commits
a4e246cf
Commit
a4e246cf
authored
2 years ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
Dockerfile => Update with multi-stage and Prisma support
parent
c6a602b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile_ExpressAPI
+30
-7
30 additions, 7 deletions
Dockerfile_ExpressAPI
with
30 additions
and
7 deletions
Dockerfile_ExpressAPI
+
30
−
7
View file @
a4e246cf
FROM node:20-bullseye
ARG BUILD_WORKDIR=/dojo/ExpressAPI
######################################################################## Build stage
FROM node:20-bullseye AS builder
LABEL maintainer="Michaël Minelli <michael-jean.minelli@hesge.ch>"
LABEL Description="Express API for Dojo"
LABEL Description="Express API for Dojo - Build stage"
ARG BUILD_WORKDIR
ADD ExpressAPI/ /dojo/ExpressAPI/
ADD
.env /dojo/ExpressAPI/.env
# Create app directory
ADD
ExpressAPI/ ${BUILD_WORKDIR}/
WORKDIR
/dojo/ExpressAPI/
WORKDIR
${BUILD_WORKDIR}
# Install app dependencies
RUN npm install
# Build app
RUN npm run build
######################################################################## Run stage
FROM node:20-bullseye
LABEL maintainer="Michaël Minelli <michael-jean.minelli@hesge.ch>"
LABEL Description="Express API for Dojo - Run stage"
ARG BUILD_WORKDIR
COPY --from=builder ${BUILD_WORKDIR}/node_modules ./node_modules
COPY --from=builder ${BUILD_WORKDIR}/package*.json ./
COPY --from=builder ${BUILD_WORKDIR}/dist ./dist
COPY --from=builder ${BUILD_WORKDIR}/prisma ./prisma
ADD .env ${BUILD_WORKDIR}/.env
EXPOSE 30992
ENTRYPOINT
[ "npm", "run", "start:prod" ]
CMD
[
"npm", "run", "start:
migrate:
prod" ]
#ENTRYPOINT ["tail", "-f", "/dev/null"]
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