Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Strapi
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
CMS
Strapi
Commits
4fe57f42
Commit
4fe57f42
authored
9 months ago
by
Richard Fernando Heise Ferreira
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/7-docker' into 'develop'
Issue
#7
: ADD docker See merge request
!9
parents
ee24b856
6cfb4cfa
No related branches found
No related tags found
1 merge request
!9
Issue #7: ADD docker
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.env.example
+7
-0
7 additions, 0 deletions
.env.example
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
.tmp/data.db
+0
-0
0 additions, 0 deletions
.tmp/data.db
Dockerfile
+30
-0
30 additions, 0 deletions
Dockerfile
docker-compose.yaml
+30
-0
30 additions, 0 deletions
docker-compose.yaml
with
68 additions
and
0 deletions
.env.example
+
7
−
0
View file @
4fe57f42
...
@@ -5,3 +5,10 @@ API_TOKEN_SALT=tobemodified
...
@@ -5,3 +5,10 @@ API_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
ADMIN_JWT_SECRET=tobemodified
TRANSFER_TOKEN_SALT=tobemodified
TRANSFER_TOKEN_SALT=tobemodified
JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
DATABASE_CLIENT=postgresql
DATABASE_HOST=strapiDB
DATABASE_PORT=5433
DATABASE_NAME=strapi
DATABASE_USERNAME=strapi_user
DATABASE_PASSWORD=123mudar
NODE_ENV=production
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.gitignore
+
1
−
0
View file @
4fe57f42
...
@@ -109,3 +109,4 @@ dist
...
@@ -109,3 +109,4 @@ dist
build
build
.strapi-updater.json
.strapi-updater.json
.strapi-cloud.json
.strapi-cloud.json
.pnpm-store
This diff is collapsed.
Click to expand it.
.tmp/data.db
+
0
−
0
View file @
4fe57f42
No preview for this file type
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
30
−
0
View file @
4fe57f42
# Creating multi-stage build for production
FROM
node:18-alpine
AS
build
RUN
apk update
&&
apk add
--no-cache
build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git
>
/dev/null 2>&1
ARG
NODE_ENV=production
ENV
NODE_ENV=${NODE_ENV}
WORKDIR
/opt/
COPY
package.json pnpm-lock.yaml ./
RUN
npm
install
-g
node-gyp
RUN
npm config
set
fetch-retry-maxtimeout 600000
-g
&&
npm
install
--only
=
production
ENV
PATH /opt/node_modules/.bin:$PATH
WORKDIR
/opt/app
COPY
. .
RUN
npm run build
# Creating final production image
FROM
node:18-alpine
RUN
apk add
--no-cache
vips-dev
ARG
NODE_ENV=production
ENV
NODE_ENV=${NODE_ENV}
WORKDIR
/opt/
COPY
--from=build /opt/node_modules ./node_modules
WORKDIR
/opt/app
COPY
--from=build /opt/app ./
ENV
PATH /opt/node_modules/.bin:$PATH
RUN
chown
-R
node:node /opt/app
USER
node
EXPOSE
1337
CMD
["npm", "run", "start"]
This diff is collapsed.
Click to expand it.
docker-compose.yaml
0 → 100644
+
30
−
0
View file @
4fe57f42
services
:
strapi
:
container_name
:
strapi
build
:
.
image
:
strapi:latest
restart
:
unless-stopped
env_file
:
.env
environment
:
DATABASE_CLIENT
:
${DATABASE_CLIENT}
DATABASE_HOST
:
strapiDB
DATABASE_PORT
:
${DATABASE_PORT}
DATABASE_NAME
:
${DATABASE_NAME}
DATABASE_USERNAME
:
${DATABASE_USERNAME}
DATABASE_PASSWORD
:
${DATABASE_PASSWORD}
JWT_SECRET
:
${JWT_SECRET}
ADMIN_JWT_SECRET
:
${ADMIN_JWT_SECRET}
APP_KEYS
:
${APP_KEYS}
NODE_ENV
:
${NODE_ENV}
volumes
:
-
./config:/opt/app/config
-
./src:/opt/app/src
-
./package.json:/opt/package.json
-
./yarn.lock:/opt/yarn.lock
-
./.env:/opt/app/.env
-
./public/uploads:/opt/app/public/uploads
ports
:
-
"
1337:1337"
volumes
:
strapi-data
:
\ 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