Skip to content

Instantly share code, notes, and snippets.

{
// ...
"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",
},
// ...
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
version: '2'
services:
sandbox.web:
build:
context: .
args:
env: sandbox
ports:
- "8080:80"
app.web:
@jinhduong
jinhduong / AccountController.cs
Created July 24, 2018 08:47
aspnetcore authorization
namespace Demo.WebApi.Controllers
{
// SIMPLE AUTHORIZATION
[Authorize]
[Route("api/[controller]")]
public class AccountController : Controller
{
public AccountController()
{
}
@jinhduong
jinhduong / .gitlab-ci.yml
Last active August 14, 2018 15:43
Gitlab CICD
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
# 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"