Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
minerva
frontend
Commits
1cc2065b
Commit
1cc2065b
authored
1 year ago
by
Tadeusz Miesiąc
Browse files
Options
Downloads
Patches
Plain Diff
chore(docker setup and ci): docker setup nad ci
parent
6932a435
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!223
reset the pin numbers before search results are fetch (so the results will be...
,
!3
Development
Pipeline
#78348
failed
1 year ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+8
-36
8 additions, 36 deletions
.gitlab-ci.yml
.nvmrc
+1
-0
1 addition, 0 deletions
.nvmrc
Dockerfile
+47
-0
47 additions, 0 deletions
Dockerfile
with
56 additions
and
36 deletions
.gitlab-ci.yml
+
8
−
36
View file @
1cc2065b
...
...
@@ -16,41 +16,13 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
stages
:
# List of stages for jobs, and their order of execution
-
lint
-
build
stages
:
-
prerequisite
-
test
-
build
-
deploy
lint:commit
:
stage
:
lint
script
:
-
npm install
-
echo "${CI_COMMIT_MESSAGE}" | npx commitlint
build-job
:
# This job runs in the build stage, which runs first.
stage
:
build
script
:
-
echo "Compiling the code..."
-
echo "Compile complete."
unit-test-job
:
# This job runs in the test stage.
stage
:
test
# It only starts when the job in the build stage completes successfully.
script
:
-
echo "Running unit tests... This will take about 60 seconds."
-
sleep
60
-
echo "Code coverage is 90%"
lint-test-job
:
# This job also runs in the test stage.
stage
:
test
# It can run at the same time as unit-test-job (in parallel).
script
:
-
echo "Linting code... This will take about 10 seconds."
-
sleep
10
-
echo "No lint issues found."
deploy-job
:
# This job runs in the deploy stage.
stage
:
deploy
# It only runs when *both* jobs in the test stage complete successfully.
environment
:
production
script
:
-
echo "Deploying application..."
-
echo "Application successfully deployed."
cache
:
paths
:
-
~/.cache
variables
:
DOCKER_DRIVER
:
overlay2
This diff is collapsed.
Click to expand it.
.nvmrc
0 → 100644
+
1
−
0
View file @
1cc2065b
16
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
47
−
0
View file @
1cc2065b
# ---- Base Node ----
FROM
node:16.17.0-alpine
AS
base
# install node
RUN
apk add
--no-cache
nodejs-current npm tini yarn
# set working directory
WORKDIR
/code
# Set tini as entrypoint
ENTRYPOINT
["/sbin/tini", "--"]
# copy project file
COPY
package.json package-lock.json yarn.lock next.config.js ./
#
# ---- Dependencies ----
FROM
base
AS
dependencies
# install git
RUN
apk add
--no-cache
git
# install node packages
RUN
npm
install
--only
=
production
# copy production node_modules aside
RUN
cp
-R
node_modules prod_node_modules
# install ALL node_modules, including 'devDependencies'
RUN
npm
install
#
# ---- Builder ----
FROM
base
AS
builder
# copy production node_modules
COPY
--from=dependencies /code/node_modules ./node_modules
# copy app sources
COPY
. .
# build app
RUN
npm build
# ---- Release ----
FROM
base
AS
release
# expose port and define CMD
EXPOSE
5000
# copy production node_modules
COPY
--from=dependencies /code/prod_node_modules ./node_modules
# copy build files
COPY
--from=builder /code/static ./static
COPY
--from=builder /code/assets ./assets
COPY
--from=builder /code/.next ./.next
CMD
yarn run start -H 0.0.0.0 -p 5000
\ No newline at end of file
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