This file contains hidden or 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
# The builder from node image | |
FROM node:alpine as builder | |
# build-time variables | |
# prod|sandbox its value will be come from outside | |
ARG env=prod | |
RUN apk update && apk add --no-cache make git | |
# Move our files into directory name "app" |
This file contains hidden or 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
{ | |
// ... | |
"scripts": { | |
"ng": "ng", | |
"start": "ng serve & gulp watch", | |
"serve": "ng serve --sourcemap=false --verbose", | |
"build:prod": "ng build --env=prod --prod --build-optimizer", | |
"build:sandbox": "ng build --env=sandbox ---prod --build-optimizer", | |
}, | |
// ... |
This file contains hidden or 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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
server { | |
listen 80; | |
server_name localhost; |
This file contains hidden or 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
version: '2' | |
services: | |
sandbox.web: | |
build: | |
context: . | |
args: | |
env: sandbox | |
ports: | |
- "8080:80" | |
app.web: |
This file contains hidden or 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
namespace Demo.WebApi.Controllers | |
{ | |
// SIMPLE AUTHORIZATION | |
[Authorize] | |
[Route("api/[controller]")] | |
public class AccountController : Controller | |
{ | |
public AccountController() | |
{ | |
} |
This file contains hidden or 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
build_image: | |
image: docker:git | |
services: | |
- docker:dind | |
script: | |
# Login to Gitlab Registry | |
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com | |
# Build image | |
- docker build -t registry.gitlab.com/<username>/<repo-name>/<docker-name>:latest --build-arg env=sandbox --build-arg <SOME-ARG>=<VALUE> . | |
# Then push image |
OlderNewer