-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start on platform dockerizing. docker-compose not functional
- Loading branch information
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.next | ||
.vscode | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.cache | ||
.tmp | ||
build | ||
exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |