Skip to content

Commit

Permalink
Merge branch 'release/0.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
azmisahin committed Jun 13, 2022
2 parents 716a287 + 1fc9163 commit 5bdf23a
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# product
ENV="development"
NAME="template"
APP_ENV="development"
APP_NAME="template"
CONTAINER="linux"

# build
Expand Down
13 changes: 7 additions & 6 deletions .devcontainer/Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=16-bullseye
# base operation system image
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} AS development
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} AS production

# Metadata indicating an image maintainer.
LABEL maintainer="Azmi ŞAHİN <[email protected]>"

# product arguments
ARG ENV="development"
ARG NAME="template"
ARG APP_ENV="development"
ARG APP_NAME="template"

# default arguments for build
ARG WORK_DIR="/template"
Expand All @@ -18,14 +18,15 @@ ARG DIST_DIR="dist"
# default arguments for application

# product environment
ENV ENV=${ENV}
ENV NAME=${NAME}
ENV APP_ENV=${ENV}
ENV APP_NAME=${NAME}

# default envionment for build
ENV WORK_DIR=${WORK_DIR}
ENV BUILD_DIR=${BUILD_DIR}
ENV DIST_DIR=${DIST_DIR}

FROM production AS development
# default environment for application

# make the 'application' folder the current working directory
Expand All @@ -46,4 +47,4 @@ RUN mkdir ${BUILD_DIR} && \
mkdir ${DIST_DIR}

# test
CMD ["node", "--version", "&& echo ${WORK_DIR}/${BUILD_DIR}/${DIST_DIR}/${NAME}"]
CMD ["node", "--version", "&& echo ${WORK_DIR}/${BUILD_DIR}/${DIST_DIR}/${APP_NAME}"]
25 changes: 13 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@
"dockerComposeFile": "docker-compose.yml",
"service": "application",
"workspaceFolder": "/workspace",

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker",
"Serhioromano.vscode-gitflow",
"mhutchie.git-graph",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"Orta.vscode-jest",
"CucumberOpen.cucumber-official",
"alexkrechik.cucumberautocomplete",
"hediet.vscode-drawio"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
// "forwardPorts": [3000, 5432],

// submodules before the container is created.
// "initializeCommand": "git submodule update --init --remote",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",

// "postCreateCommand": "docker --version",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
"remoteUser": "node",
// features to add to the dev container
"features": {
"docker-from-docker": "latest"
// "docker-in-docker": "latest",
// "git": "latest"
}
}
10 changes: 5 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ services:
# Use -bullseye variants on local arm64/Apple Silicon.
VARIANT: 16-bullseye
# build
NAME: ${NAME}
APP_NAME: ${APP_NAME}
WORK_DIR: ${WORK_DIR}
BUILD_DIR: ${BUILD_DIR}
DIST_DIR: ${DIST_DIR}
# application
labels:
com.azmisahin.description: ${NAME}
com.azmisahin.description: ${APP_NAME}
com.azmisahin.department: "DEVOPS"
# stage
target: ${ENV}
container_name: ${NAME}-${ENV}-${CONTAINER}
target: ${APP_NAME}
container_name: ${APP_NAME}-${APP_ENV}-${CONTAINER}
environment:
# build
NAME: ${NAME}
NAME: ${APP_NAME}
WORK_DIR: ${WORK_DIR}
BUILD_DIR: ${BUILD_DIR}
DIST_DIR: ${DIST_DIR}
Expand Down
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# product
ENV="production"
NAME="template"
APP_ENV="production"
APP_NAME="template"
CONTAINER="linux"

# build
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
10 changes: 5 additions & 5 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ FROM node:latest AS production
LABEL maintainer="Azmi ŞAHİN <[email protected]>"

# product arguments
ARG ENV="production"
ARG NAME="template"
ARG APP_ENV="production"
ARG APP_NAME="template"

# default arguments for build
ARG WORK_DIR="/template"
Expand All @@ -17,8 +17,8 @@ ARG DIST_DIR="dist"


# product environment
ENV ENV=${ENV}
ENV NAME=${NAME}
ENV APP_ENV=${APP_ENV}
ENV APP_NAME=${APP_NAME}

# default envionment for build
ENV WORK_DIR=${WORK_DIR}
Expand All @@ -43,4 +43,4 @@ RUN mkdir ${BUILD_DIR} && \
mkdir ${DIST_DIR}

# test
CMD ["npm", "run", "test:features"]
# CMD ["npm", "run", "test:features"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Introduction
Software webpack template for nodejs javascript scripting language : version 0.1

🔖: releasing / 0.1.2

## Example
```js
// package define
Expand Down
27 changes: 18 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,38 @@ services:
dockerfile: Dockerfile.${CONTAINER}
args:
# build
NAME: ${NAME}
APP_NAME: ${APP_NAME}
WORK_DIR: ${WORK_DIR}
BUILD_DIR: ${BUILD_DIR}
DIST_DIR: ${DIST_DIR}

# application

labels:
com.azmisahin.description: ${NAME}
com.azmisahin.description: ${APP_NAME}
com.azmisahin.department: "DEVOPS"
# stage
target: ${ENV}
container_name: ${NAME}-${ENV}-${CONTAINER}
target: ${APP_ENV}
container_name: ${APP_NAME}-${APP_ENV}-${CONTAINER}
environment:
# build
NAME: ${NAME}
APP_NAME: ${APP_NAME}
WORK_DIR: ${WORK_DIR}
BUILD_DIR: ${BUILD_DIR}
DIST_DIR: ${DIST_DIR}

# application

networks:
default: null
restart: "no"
tty: true
# volumes:
# - ..:/vhost

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
# network_mode: service:xxx

# Uncomment the next line to use a non-root user for all processes.
# user: node

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "package-template-javascript",
"version": "0.1.1",
"version": "0.1.2",
"description": "Software webpack template for nodejs javascript scripting language : version 0.1",
"main": "src",
"directories": {
Expand Down

0 comments on commit 5bdf23a

Please sign in to comment.