Skip to content

Commit

Permalink
start on platform dockerizing. docker-compose not functional
Browse files Browse the repository at this point in the history
  • Loading branch information
RmnRss committed Aug 3, 2020
1 parent e3d3af5 commit 8da8ee9
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.next
.vscode
npm-debug.log
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:12

# Create app directory
WORKDIR /usr/src/app

# Copy packages to the docker image
COPY package*.json ./

# Installing dependencies
RUN npm install

# If you are building your code for production
# RUN npm ci --only=production

# Copy the rest of the content
COPY . .

# Opening port 3000
EXPOSE 3000:3000

# Starting server
CMD [ "npm", "run", "dev" ]
5 changes: 5 additions & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.cache
.tmp
build
exports
24 changes: 24 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM strapi/base AS build

# Create app directory
WORKDIR /usr/srv/app

# Copy packages to the docker image
COPY package*.json ./

# Installing dependencies
RUN npm install

# If you are building your code for production
# RUN npm ci --only=production

# Copy the rest of the content
COPY . .

# Opening port 1337
EXPOSE 1337:1337

VOLUME [ "./:/srv/app" ]

# Starting server
CMD [ "npm", "run", "develop" ]
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.8"

services:
strapi:
build: ./api
container_name: strapi
image: strapi/base
working_dir: /srv/app
command: sh -c "npm install && npm run develop"
ports:
- "1337:1337"
volumes:
- ./api:/srv/app
restart: "no"

next:
container_name: next
image: node:12
working_dir: /app
command: sh -c "npm install && npm run dev"
ports:
- "3000:3000"
volumes:
- .:/app
depends_on:
- strapi

0 comments on commit 8da8ee9

Please sign in to comment.