Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
5 changes: 5 additions & 0 deletions apps/backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.tmp/
.cache/
.git/
build/
node_modules/
4 changes: 1 addition & 3 deletions apps/backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
HOST=0.0.0.0
PORT=1337

# run generate-secrets.sh
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
1 change: 1 addition & 0 deletions apps/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ $RECYCLE.BIN/
*.sql
*.sqlite
*.sqlite3
*.db


############################
Expand Down
12 changes: 12 additions & 0 deletions apps/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:16
ARG NODE_ENV=development
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/
COPY ./package.json ./package-lock.json ./
ENV PATH /opt/node_modules/.bin:$PATH
RUN npm install
WORKDIR /opt/app
COPY ./ .
RUN npm run build
EXPOSE ${PORT}
CMD ["npm", "run", "develop"]
6 changes: 6 additions & 0 deletions apps/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

```
docker build -t strapi .
docker compose build
docker compose up
```
34 changes: 17 additions & 17 deletions apps/backend/config/config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = ({ env }) => ({
ckeditor: {
enabled: true,
},
placeholder: {
enabled: true,
config: {
size: 10,
ckeditor: {
enabled: true,
},
},
navigation: {
enabled: true,
gql: {
navigationItemRelated: ['Entry', 'Tag', 'UploadFile'],
placeholder: {
enabled: true,
config: {
size: 10,
},
},
},
graphql: {
enabled: true
},
});
navigation: {
enabled: true,
gql: {
navigationItemRelated: ['Entry', 'Tag', 'UploadFile'],
},
},
graphql: {
enabled: true
},
});
2 changes: 1 addition & 1 deletion apps/backend/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = ({ env }) => ({
connection: {
client: 'sqlite',
connection: {
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', 'database/data.db')),
},
useNullAsDefault: true,
},
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/config/plugins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'navigation': { enabled: true },
'graphql': { enabled: true },
'navigation': { enabled: true },
'graphql': { enabled: true },
};
33 changes: 33 additions & 0 deletions apps/backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3'
services:
strapi:
container_name: strapi
build: .
image: strapi:latest
restart: unless-stopped
env_file: .env
environment:
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
- ./package-lock.json:/opt/package-lock.json
- ./.env:/opt/app/.env
- ./public/uploads:/opt/app/public/uploads
- ./database/data.db:/opt/app/database/data.db
ports:
- '1337:1337'
networks:
- strapi

volumes:
strapi-data:

networks:
strapi:
name: Strapi
driver: bridge
Loading