-
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.
- Loading branch information
Showing
10 changed files
with
104 additions
and
13 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,32 @@ | ||
{ | ||
"name": "Existing Dockerfile", | ||
|
||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
|
||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. | ||
"dockerFile": "../Dockerfile", | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": null | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [] | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Uncomment the next line to run commands after the container is created - for example installing curl. | ||
// "postCreateCommand": "apt-get update && apt-get install -y curl", | ||
|
||
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust | ||
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], | ||
|
||
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. | ||
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], | ||
|
||
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. | ||
// "remoteUser": "vscode" | ||
} |
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
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,11 @@ | ||
version: '3.7' | ||
|
||
services: | ||
|
||
modos-prod: | ||
container_name: modos-prod | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.prod | ||
ports: | ||
- '1337:80' |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
# base image | ||
FROM node:8.4 | ||
# pull official base image | ||
FROM node:13.12.0-alpine | ||
|
||
# set working directory | ||
WORKDIR /Users/jorgenunes/webdev/modos | ||
WORKDIR /app | ||
|
||
# install and cache app dependencies | ||
COPY package*.json ./ | ||
ADD package.json /usr/src/app/package.json | ||
RUN npm install | ||
RUN npm install [email protected] -g | ||
# add `/app/node_modules/.bin` to $PATH | ||
ENV PATH /app/node_modules/.bin:$PATH | ||
|
||
# bundle app source | ||
COPY . . | ||
# install app dependencies | ||
COPY package.json ./ | ||
COPY package-lock.json ./ | ||
RUN npm install --silent | ||
RUN npm install [email protected] -g --silent | ||
|
||
EXPOSE 3000 | ||
# add app | ||
COPY . ./ | ||
|
||
# start app | ||
CMD ["npm", "start"] | ||
|
||
CMD ["npm", "start"] |
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,16 @@ | ||
# build environment | ||
FROM node:13.12.0-alpine as build | ||
WORKDIR /app | ||
ENV PATH /app/node_modules/.bin:$PATH | ||
COPY package.json ./ | ||
COPY package-lock.json ./ | ||
RUN npm ci --silent | ||
RUN npm install [email protected] -g --silent | ||
COPY . ./ | ||
RUN npm run build | ||
|
||
# production environment | ||
FROM nginx:stable-alpine | ||
COPY --from=build /app/build /usr/share/nginx/html | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
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,16 @@ | ||
version: '3.7' | ||
|
||
services: | ||
|
||
modos: | ||
container_name: modos | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- '.:/app' | ||
- '/app/node_modules' | ||
ports: | ||
- 3001:3000 | ||
environment: | ||
- CHOKIDAR_USEPOLLING=true |
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 | ||
build | ||
.dockerignore | ||
Dockerfile | ||
Dockerfile.prod |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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