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
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test PR

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
cd api
npm install
cd ..
cd frontend-app
npm install
- name: Run Tests
run: |
cd api
npm test
cd ..
cd frontend-app
npm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ dist

# TernJS port file
.tern-port

api_data_tmp/
api_data_upload/
20 changes: 20 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Set the base image to use for this Docker image
FROM node:14.16.0-alpine

# Set the working directory for the Docker image
WORKDIR /app

# Copy the package.json and package-lock.json files into the Docker image
COPY package*.json ./

# Install the dependencies in the Docker image
RUN npm install

# Copy the rest of the application files into the Docker image
COPY . .

# Set the port that the Docker image will use
EXPOSE 1337

# Start the Strapi server when the Docker image runs
CMD ["npm", "start"]
3 changes: 2 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
"strapi": "strapi",
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
"@strapi/plugin-i18n": "4.3.8",
Expand Down
16 changes: 16 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3"

services:
strapi:
build:
context: ./api
ports:
- "1337:1337"
volumes:
- ./api_data_upload:/app/public/uploads
- ./api_data_tmp:/app/.tmp
nextjs:
build:
context: ./frontend-app
ports:
- "3000:3000"
Empty file added docker-compose.staging.yml
Empty file.
28 changes: 28 additions & 0 deletions frontend-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Base image
FROM node:16-alpine

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy application files
COPY . .

# Build Next.js application
RUN npm run build

# Set environment variables
ENV NODE_ENV production
ENV PORT 3000
ENV NEXT_PUBLIC_API_BASE_URL http://localhost:1337

# Expose port
EXPOSE 3000

# Start server
CMD ["npm", "start"]
3 changes: 2 additions & 1 deletion frontend-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
"axios": "^0.27.2",
Expand Down