Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CaCaoCritics
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
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bilel El Yaagoubi
CaCaoCritics
Commits
1c546be2
Commit
1c546be2
authored
3 years ago
by
Bilel El Yaagoubi
Browse files
Options
Downloads
Patches
Plain Diff
dockerise back
parent
50e5a3fc
Branches
Branches containing commit
No related tags found
1 merge request
!2
Ocotbranche
Pipeline
#42238
passed
3 years ago
Stage: lint
Stage: build
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/.dockerignore
+6
-0
6 additions, 0 deletions
backend/.dockerignore
backend/Dockerfile
+16
-0
16 additions, 0 deletions
backend/Dockerfile
backend/server.js
+2
-2
2 additions, 2 deletions
backend/server.js
with
24 additions
and
2 deletions
backend/.dockerignore
0 → 100644
+
6
−
0
View file @
1c546be2
.dockerignore
.env.example
.eslintrc.js
Dockerfile
.gitignore
This diff is collapsed.
Click to expand it.
backend/Dockerfile
0 → 100644
+
16
−
0
View file @
1c546be2
FROM
node:12.4
WORKDIR
/usr/src/app
COPY
package.json package-lock.json ./
RUN
npm
install
COPY
. .
RUN
touch
.env
EXPOSE
3000
ENTRYPOINT
echo "PORT=$PORT" >> .env && echo "NODE_ENV=$NODE_ENV" >> .env \
&& echo "MONGO_DB_URL=$MONGO_DB_URL" >> .env && node server.js
\ No newline at end of file
This diff is collapsed.
Click to expand it.
backend/server.js
+
2
−
2
View file @
1c546be2
const
express
=
require
(
"
express
"
);
const
express
=
require
(
"
express
"
);
const
logger
=
require
(
"
morgan
"
);
const
logger
=
require
(
"
morgan
"
);
const
cors
=
require
(
"
cors
"
);
const
cors
=
require
(
"
cors
"
);
const
mongoose
=
require
(
"
mongoose
"
);
//
const mongoose = require("mongoose");
const
indexRouter
=
require
(
"
./routes/index
"
);
const
indexRouter
=
require
(
"
./routes/index
"
);
const
usersRouter
=
require
(
"
./routes/users
"
);
const
usersRouter
=
require
(
"
./routes/users
"
);
const
routeNotFoundJsonHandler
=
require
(
"
./services/routeNotFoundJsonHandler
"
);
const
routeNotFoundJsonHandler
=
require
(
"
./services/routeNotFoundJsonHandler
"
);
const
jsonErrorHandler
=
require
(
"
./services/jsonErrorHandler
"
);
const
jsonErrorHandler
=
require
(
"
./services/jsonErrorHandler
"
);
mongoose
.
connect
(
process
.
env
.
MONGO_DB_URL
);
//
mongoose.connect(process.env.MONGO_DB_URL);
const
app
=
express
();
const
app
=
express
();
...
...
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