#!/bin/bash
# Docker Compose commands
# Start all services
docker compose up -d
# Optimized production Dockerfile
# Stage 1: Dependencies
FROM node:20-alpine AS deps
WORKDIR /app
stages:
- lint
- test
- build
- deploy
# Backend configuration with S3 + DynamoDB locking
terraform {
backend "s3" {
bucket = "company-terraform-state"
key = "services/web-app/terraform.tfstate"
region = "us-east-1"
# Prometheus configuration
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_timeout: 10s
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-service
labels:
app: user-service
# Project Makefile
.DEFAULT_GOAL := help
# Variables
APP_NAME := web-app
VERSION := $(shell git describe --tags --always --dirty)
#!/bin/bash
# Linux system administration commands
# === Process Management ===
ps aux # All processes
ps aux | grep nginx # Find specific process
# Pre-commit hooks configuration
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
---
# Main playbook
- name: Configure web servers
hosts: webservers
become: yes
vars:
// Configuration management with validation
const Joi = require('joi');
// Define schema for all environment variables
const envSchema = Joi.object({
NODE_ENV: Joi.string()
# Multi-stage build for a Node.js application
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app