├── .gitattributes ├── .github ├── CODEOWNERS └── workflows │ └── codeql-analysis.yml ├── CONTRIBUTING.md ├── LICENSE ├── MAINTAINERS ├── README.md ├── angular ├── .docker │ └── docker-compose.yaml ├── .gitignore ├── README.md ├── angular │ ├── .browserslistrc │ ├── .dockerignore │ ├── .editorconfig │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── angular.json │ ├── karma.conf.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ └── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── compose.yaml └── output.png ├── apache-php ├── .docker │ └── docker-compose.yaml ├── README.md ├── app │ ├── Dockerfile │ └── index.php └── compose.yaml ├── aspnet-mssql ├── README.md ├── app │ ├── aspnetapp.sln │ └── aspnetapp │ │ ├── .gitignore │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Dockerfile │ │ ├── Models │ │ └── ErrorViewModel.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── aspnetapp.csproj │ │ └── wwwroot │ │ ├── css │ │ ├── site.css │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── images │ │ ├── banner1.svg │ │ ├── banner2.svg │ │ └── banner3.svg │ │ ├── js │ │ ├── site.js │ │ └── site.min.js │ │ └── lib │ │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── compose.yaml └── output.jpg ├── awesome-compose.jpg ├── django ├── .docker │ └── docker-compose.yaml ├── README.md ├── app │ ├── Dockerfile │ ├── example │ │ ├── __init__.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── manage.py │ └── requirements.txt └── compose.yaml ├── elasticsearch-logstash-kibana ├── README.md ├── compose.yaml └── logstash │ ├── nginx.log │ └── pipeline │ └── logstash-nginx.config ├── fastapi ├── .docker │ └── docker-compose.yaml ├── Dockerfile ├── README.md ├── app │ ├── __init__.py │ └── main.py ├── compose.yaml └── requirements.txt ├── flask-redis ├── .docker │ └── docker-compose.yaml ├── Dockerfile ├── README.md ├── app.py ├── compose.yaml └── requirements.txt ├── flask ├── .docker │ └── docker-compose.yaml ├── README.md ├── app │ ├── Dockerfile │ ├── app.py │ └── requirements.txt └── compose.yaml ├── gitea-postgres ├── README.md ├── compose.yaml └── output.jpg ├── icon_devenvs.svg ├── minecraft ├── README.md ├── compose.yaml └── screenshots │ ├── add-server-config.png │ ├── click-add-server.png │ └── ready-to-play.png ├── nextcloud-postgres ├── README.md ├── compose.yaml └── output.jpg ├── nextcloud-redis-mariadb ├── README.md ├── compose.yaml └── output.jpg ├── nginx-aspnet-mysql ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── .gitignore │ ├── Dockerfile │ ├── Program.cs │ └── aspnetapp.csproj ├── compose.yaml ├── db │ └── password.txt └── proxy │ ├── Dockerfile │ └── conf ├── nginx-flask-mongo ├── .docker │ └── docker-compose.yaml ├── README.md ├── compose.yaml ├── flask │ ├── Dockerfile │ ├── requirements.txt │ └── server.py └── nginx │ └── nginx.conf ├── nginx-flask-mysql ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── hello.py │ └── requirements.txt ├── compose.yaml ├── db │ └── password.txt └── proxy │ ├── Dockerfile │ └── conf ├── nginx-golang-mysql ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── go.mod │ ├── go.sum │ └── main.go ├── compose.yaml ├── db │ └── password.txt └── proxy │ └── nginx.conf ├── nginx-golang-postgres ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── go.mod │ ├── go.sum │ └── main.go ├── compose.yaml ├── db │ └── password.txt └── proxy │ └── nginx.conf ├── nginx-golang ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── go.mod │ ├── go.sum │ └── main.go ├── compose.yaml └── proxy │ └── nginx.conf ├── nginx-nodejs-redis ├── README.md ├── compose.yaml ├── nginx │ ├── Dockerfile │ └── nginx.conf └── web │ ├── .gitignore │ ├── Dockerfile │ ├── package-lock.json │ ├── package.json │ └── server.js ├── nginx-wsgi-flask ├── README.md ├── compose.yaml ├── flask │ ├── Dockerfile │ ├── app.py │ ├── requirements.txt │ └── wsgi.py └── nginx │ ├── Dockerfile │ ├── default.conf │ ├── nginx.conf │ └── start.sh ├── official-documentation-samples ├── README.md ├── django │ ├── README.md │ └── images │ │ └── django-it-worked.png ├── rails │ ├── README.md │ └── images │ │ └── rails-welcome.png └── wordpress │ ├── README.md │ └── images │ ├── wordpress-lang.png │ └── wordpress-welcome.png ├── open_in_new.svg ├── pihole-cloudflared-DoH ├── .env ├── README.md └── compose.yaml ├── plex ├── .env ├── README.md └── compose.yaml ├── portainer ├── README.md └── compose.yaml ├── postgresql-pgadmin ├── .env ├── README.md └── compose.yaml ├── prometheus-grafana ├── README.md ├── compose.yaml ├── grafana │ └── datasource.yml ├── output.jpg └── prometheus │ └── prometheus.yml ├── react-express-mongodb ├── .docker │ └── docker-compose.yaml ├── .gitignore ├── README.md ├── backend │ ├── .dockerignore │ ├── Dockerfile │ ├── README.md │ ├── config │ │ ├── config.js │ │ ├── config.json │ │ └── messages.js │ ├── db │ │ └── index.js │ ├── logs │ │ └── .gitkeep │ ├── models │ │ └── todos │ │ │ └── todo.js │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ └── index.js │ ├── server.js │ └── utils │ │ └── helpers │ │ ├── logger.js │ │ └── responses.js ├── compose.yaml ├── frontend │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.js │ │ ├── App.scss │ │ ├── App.test.js │ │ ├── components │ │ ├── AddTodo.js │ │ └── TodoList.js │ │ ├── custom.scss │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ └── serviceWorker.js └── output.png ├── react-express-mysql ├── .docker │ └── docker-compose.yaml ├── .gitignore ├── README.md ├── backend │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── healthcheck.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── config.js │ │ ├── database.js │ │ ├── index.js │ │ └── server.js │ └── test │ │ └── sample.js ├── compose.yaml ├── db │ └── password.txt ├── frontend │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── serviceWorker.js │ │ ├── setupProxy.js │ │ └── setupTests.js └── output.png ├── react-java-mysql ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── company │ │ │ └── project │ │ │ ├── Application.java │ │ │ ├── configuration │ │ │ └── DockerSecretsProcessor.java │ │ │ ├── controllers │ │ │ └── HomeController.java │ │ │ ├── entity │ │ │ └── Greeting.java │ │ │ └── repository │ │ │ └── GreetingRepository.java │ │ └── resources │ │ ├── META-INF │ │ └── spring.factories │ │ ├── application.properties │ │ ├── data.sql │ │ └── schema.sql ├── compose.yaml ├── db │ └── password.txt ├── frontend │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ ├── src │ │ ├── App.css │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── index.css │ │ ├── index.tsx │ │ ├── logo.svg │ │ ├── react-app-env.d.ts │ │ ├── serviceWorker.ts │ │ ├── setupProxy.js │ │ └── setupTests.ts │ └── tsconfig.json └── output.jpg ├── react-nginx ├── .docker │ └── docker-compose.yaml ├── .dockerignore ├── .gitignore ├── .nginx │ └── nginx.conf ├── Dockerfile ├── README.md ├── compose.yaml ├── output.png ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js ├── react-rust-postgres ├── .docker │ └── docker-compose.yaml ├── backend │ ├── .dockerignore │ ├── .gitignore │ ├── Cargo.toml │ ├── Dockerfile │ ├── migrations │ │ ├── .gitkeep │ │ ├── 0001_create-users_down.sql │ │ └── 0001_create-users_up.sql │ ├── readme.md │ └── src │ │ ├── main.rs │ │ ├── postgres.rs │ │ └── user.rs ├── capture.png ├── compose.yaml ├── frontend │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── serviceWorker.js │ │ ├── setupProxy.js │ │ └── setupTests.js └── readme.md ├── sparkjava-mysql ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── App.java ├── compose.yaml └── db │ └── password.txt ├── sparkjava ├── .docker │ └── docker-compose.yaml ├── README.md ├── compose.yaml └── sparkjava │ ├── Dockerfile │ ├── pom.xml │ └── src │ └── main │ └── java │ └── App.java ├── spring-postgres ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── company │ │ │ └── project │ │ │ ├── Application.java │ │ │ ├── controllers │ │ │ └── HomeController.java │ │ │ ├── entity │ │ │ └── Greeting.java │ │ │ └── repository │ │ │ └── GreetingRepository.java │ │ └── resources │ │ ├── application.properties │ │ ├── data.sql │ │ ├── schema.sql │ │ └── templates │ │ └── home.ftlh ├── compose.yaml └── db │ └── password.txt ├── traefik-golang ├── .docker │ └── docker-compose.yaml ├── README.md ├── backend │ ├── Dockerfile │ └── main.go └── compose.yaml ├── vuejs ├── .docker │ └── docker-compose.yaml ├── .gitignore ├── README.md ├── compose.yaml ├── output.jpg └── vuejs │ ├── Dockerfile │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ └── HelloWorld.vue │ └── main.js │ └── yarn.lock ├── wireguard ├── .env ├── README.md └── compose.yaml └── wordpress-mysql ├── README.md ├── compose.yaml └── output.jpg /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | readme.md merge=union 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * aiordache glours 2 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | analyze: 9 | name: Analyze 10 | runs-on: ubuntu-latest 11 | 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | language: [ 'go', 'typescript', 'python' ] 16 | 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v2 20 | 21 | - name: Initialize CodeQL 22 | uses: github/codeql-action/init@v1 23 | with: 24 | languages: ${{ matrix.language }} 25 | 26 | - name: Autobuild 27 | uses: github/codeql-action/autobuild@v1 28 | 29 | - name: Perform CodeQL Analysis 30 | uses: github/codeql-action/analyze@v1 31 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | # Awesome Compose maintainers file 2 | # 3 | # This file describes who runs the docker/awesome-compose project and how. 4 | # This is a living document - if you see something out of date or missing, speak up! 5 | # 6 | # It is structured to be consumable by both humans and programs. 7 | # To extract its contents programmatically, use any TOML-compliant parser. 8 | # 9 | # This file is compiled into the MAINTAINERS file in docker/opensource. 10 | # 11 | [Org] 12 | [Org."Core maintainers"] 13 | people = [ 14 | "aiordache", 15 | "glours" 16 | ] 17 | [Org.Alumni] 18 | people = [ 19 | ] 20 | 21 | [people] 22 | 23 | # A reference list of all people associated with the project. 24 | # All other sections should refer to people by their canonical key 25 | # in the people section. 26 | 27 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 28 | 29 | [people.aiordache] 30 | Name = "Anca iordache" 31 | Email = "anca.iordache@docker.com" 32 | GitHub = "aiordache" 33 | 34 | [people.glours] 35 | Name = "Guillaume Lours" 36 | Email = "guillaume.lours@docker.com" 37 | GitHub = "glours" 38 | -------------------------------------------------------------------------------- /angular/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: 4 | context: angular 5 | target: dev-envs 6 | ports: 7 | - 4200:4200 8 | volumes: 9 | - /var/run/docker.sock:/var/run/docker.sock 10 | - ./angular:/project 11 | - /project/node_modules 12 | -------------------------------------------------------------------------------- /angular/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /angular/angular/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | -------------------------------------------------------------------------------- /angular/angular/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /angular/angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /angular/angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | 16 | # IDEs and editors 17 | /.idea 18 | .project 19 | .classpath 20 | .c9/ 21 | *.launch 22 | .settings/ 23 | *.sublime-workspace 24 | 25 | # IDE - VSCode 26 | .vscode/* 27 | !.vscode/settings.json 28 | !.vscode/tasks.json 29 | !.vscode/launch.json 30 | !.vscode/extensions.json 31 | .history/* 32 | 33 | # misc 34 | /.angular/cache 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /angular/angular/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM node:17.0.1-bullseye-slim as builder 4 | 5 | RUN mkdir /project 6 | WORKDIR /project 7 | 8 | RUN npm install -g @angular/cli@13 9 | 10 | COPY package.json package-lock.json ./ 11 | RUN npm ci 12 | 13 | COPY . . 14 | CMD ["ng", "serve", "--host", "0.0.0.0"] 15 | 16 | FROM builder as dev-envs 17 | 18 | RUN < { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'angular'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('angular'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('angular app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /angular/angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'angular'; 10 | } 11 | -------------------------------------------------------------------------------- /angular/angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | AppRoutingModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /angular/angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/angular/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular/angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular/angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /angular/angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/angular/angular/src/favicon.ico -------------------------------------------------------------------------------- /angular/angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /angular/angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /angular/angular/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angular/angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | ); 22 | 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().map(context); 27 | -------------------------------------------------------------------------------- /angular/angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /angular/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "es2017", 20 | "module": "es2020", 21 | "lib": [ 22 | "es2020", 23 | "dom" 24 | ] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /angular/angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /angular/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: 4 | context: angular 5 | target: builder 6 | ports: 7 | - 4200:4200 8 | volumes: 9 | - ./angular:/project 10 | - /project/node_modules 11 | -------------------------------------------------------------------------------- /angular/output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/angular/output.png -------------------------------------------------------------------------------- /apache-php/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: 4 | context: app 5 | target: dev-envs 6 | ports: 7 | - '80:80' 8 | volumes: 9 | - /var/run/docker.sock:/var/run/docker.sock 10 | - ./app:/var/www/html/ 11 | -------------------------------------------------------------------------------- /apache-php/app/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM php:8.0.9-apache as builder 4 | 5 | CMD ["apache2-foreground"] 6 | 7 | FROM builder as dev-envs 8 | 9 | RUN <Hello World!'; 3 | ?> 4 | -------------------------------------------------------------------------------- /apache-php/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: 4 | context: app 5 | target: builder 6 | ports: 7 | - '80:80' 8 | volumes: 9 | - ./app:/var/www/html/ 10 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using aspnetapp.Models; 8 | 9 | namespace aspnetapp.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult About() 19 | { 20 | ViewData["Message"] = "Your application description page."; 21 | 22 | return View(); 23 | } 24 | 25 | public IActionResult Contact() 26 | { 27 | ViewData["Message"] = "Your contact page."; 28 | 29 | return View(); 30 | } 31 | 32 | public IActionResult Privacy() 33 | { 34 | return View(); 35 | } 36 | 37 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 38 | public IActionResult Error() 39 | { 40 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM mcr.microsoft.com/dotnet/aspnet:5.0 as base 3 | WORKDIR /app 4 | 5 | FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 6 | COPY . /src 7 | WORKDIR /src 8 | RUN ls 9 | RUN dotnet build "aspnetapp.csproj" -c Release -o /app/build 10 | 11 | FROM build AS publish 12 | RUN dotnet publish "aspnetapp.csproj" -c Release -o /app/publish 13 | 14 | FROM base AS final 15 | WORKDIR /app 16 | COPY --from=publish /app/publish . 17 | ENTRYPOINT ["dotnet", "aspnetapp.dll"] -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace aspnetapp.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using aspnetapp; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | CreateHostBuilder(args).Build().Run(); 13 | } 14 | 15 | public static IHostBuilder CreateHostBuilder(string[] args) => 16 | Host.CreateDefaultBuilder(args) 17 | .ConfigureWebHostDefaults(webBuilder => 18 | { 19 | webBuilder.UseStartup(); 20 | }); 21 | } -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using aspnetapp 2 | @using aspnetapp.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/aspnetapp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net5.0 4 | 5 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/app/aspnetapp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/app/aspnetapp/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "https://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jquery-validation/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.17.0", 31 | "_release": "1.17.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.17.0", 35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772" 36 | }, 37 | "_source": "https://github.com/jzaefferer/jquery-validation.git", 38 | "_target": "^1.17.0", 39 | "_originalSource": "jquery-validation", 40 | "_direct": true 41 | } -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /aspnet-mssql/app/aspnetapp/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /aspnet-mssql/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: app/aspnetapp 4 | ports: 5 | - 80:80 6 | db: 7 | environment: 8 | ACCEPT_EULA: "Y" 9 | SA_PASSWORD: example_123 10 | # mssql server image isn't available for arm64 architecture, so we use azure-sql instead 11 | image: mcr.microsoft.com/azure-sql-edge:1.0.4 12 | # If you really want to use MS SQL Server, uncomment the following line 13 | #image: mcr.microsoft.com/mssql/server 14 | restart: always 15 | healthcheck: 16 | test: ["CMD-SHELL", "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P example_123 -Q 'SELECT 1' || exit 1"] 17 | interval: 10s 18 | retries: 10 19 | start_period: 10s 20 | timeout: 3s 21 | 22 | 23 | -------------------------------------------------------------------------------- /aspnet-mssql/output.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/aspnet-mssql/output.jpg -------------------------------------------------------------------------------- /awesome-compose.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/awesome-compose.jpg -------------------------------------------------------------------------------- /django/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | build: 4 | context: app 5 | target: dev-envs 6 | ports: 7 | - '8000:8000' 8 | volumes: 9 | - /var/run/docker.sock:/var/run/docker.sock -------------------------------------------------------------------------------- /django/app/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM python:3.7-alpine AS builder 4 | EXPOSE 8000 5 | WORKDIR /app 6 | COPY requirements.txt /app 7 | RUN pip3 install -r requirements.txt --no-cache-dir 8 | COPY . /app 9 | ENTRYPOINT ["python3"] 10 | CMD ["manage.py", "runserver", "0.0.0.0:8000"] 11 | 12 | FROM builder as dev-envs 13 | RUN < "/home/nginx.log" 4 | start_position => "beginning" 5 | sincedb_path => "/dev/null" 6 | } 7 | } 8 | 9 | filter { 10 | json { 11 | source => "message" 12 | } 13 | geoip { 14 | source => "remote_ip" 15 | } 16 | useragent { 17 | source => "agent" 18 | target => "useragent" 19 | } 20 | } 21 | 22 | output { 23 | elasticsearch { 24 | hosts => ["http://es:9200"] 25 | index => "nginx" 26 | } 27 | stdout { 28 | codec => rubydebug 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fastapi/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | api: 3 | build: 4 | context: . 5 | target: dev-envs 6 | container_name: fastapi-application 7 | environment: 8 | PORT: 8000 9 | ports: 10 | - '8000:8000' 11 | volumes: 12 | - /var/run/docker.sock:/var/run/docker.sock 13 | restart: "no" 14 | -------------------------------------------------------------------------------- /fastapi/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax = docker/dockerfile:1.4 2 | 3 | FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9-slim AS builder 4 | 5 | WORKDIR /app 6 | 7 | COPY requirements.txt ./ 8 | RUN --mount=type=cache,target=/root/.cache/pip \ 9 | pip install -r requirements.txt 10 | 11 | COPY ./app ./app 12 | 13 | FROM builder as dev-envs 14 | 15 | RUN < 2 | 3 | net6.0 4 | enable 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /nginx-aspnet-mysql/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | backend: 3 | build: 4 | context: backend 5 | restart: always 6 | secrets: 7 | - db-password 8 | depends_on: 9 | db: 10 | condition: service_healthy 11 | environment: 12 | - ASPNETCORE_URLS=http://+:8000 13 | 14 | db: 15 | # We use a mariadb image which supports both amd64 & arm64 architecture 16 | image: mariadb:10-focal 17 | # If you really want to use MySQL, uncomment the following line 18 | #image: mysql:8 19 | command: '--default-authentication-plugin=mysql_native_password' 20 | restart: always 21 | healthcheck: 22 | test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --password="$$(cat /run/secrets/db-password)" --silent'] 23 | interval: 3s 24 | retries: 5 25 | start_period: 30s 26 | secrets: 27 | - db-password 28 | volumes: 29 | - db-data:/var/lib/mysql 30 | environment: 31 | - MYSQL_DATABASE=example 32 | - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password 33 | 34 | proxy: 35 | build: proxy 36 | ports: 37 | - 80:80 38 | depends_on: 39 | - backend 40 | 41 | volumes: 42 | db-data: 43 | 44 | secrets: 45 | db-password: 46 | file: db/password.txt 47 | -------------------------------------------------------------------------------- /nginx-aspnet-mysql/db/password.txt: -------------------------------------------------------------------------------- 1 | db-q5n2g -------------------------------------------------------------------------------- /nginx-aspnet-mysql/proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.13-alpine 2 | COPY conf /etc/nginx/conf.d/default.conf -------------------------------------------------------------------------------- /nginx-aspnet-mysql/proxy/conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | location / { 5 | proxy_pass http://backend:8000; 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /nginx-flask-mongo/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | image: nginx 4 | volumes: 5 | - ./nginx/nginx.conf:/tmp/nginx.conf 6 | environment: 7 | - FLASK_SERVER_ADDR=backend:9091 8 | command: /bin/bash -c "envsubst < /tmp/nginx.conf > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" 9 | ports: 10 | - 80:80 11 | depends_on: 12 | - backend 13 | 14 | backend: 15 | build: 16 | context: flask 17 | target: dev-envs 18 | stop_signal: SIGINT 19 | environment: 20 | - FLASK_SERVER_PORT=9091 21 | volumes: 22 | - /var/run/docker.sock:/var/run/docker.sock 23 | depends_on: 24 | - mongo 25 | 26 | mongo: 27 | image: mongo 28 | -------------------------------------------------------------------------------- /nginx-flask-mongo/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | web: 3 | image: nginx 4 | volumes: 5 | - ./nginx/nginx.conf:/tmp/nginx.conf 6 | environment: 7 | - FLASK_SERVER_ADDR=backend:9091 8 | command: /bin/bash -c "envsubst < /tmp/nginx.conf > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" 9 | ports: 10 | - 80:80 11 | depends_on: 12 | - backend 13 | 14 | backend: 15 | build: 16 | context: flask 17 | target: builder 18 | # flask requires SIGINT to stop gracefully 19 | # (default stop signal from Compose is SIGTERM) 20 | stop_signal: SIGINT 21 | environment: 22 | - FLASK_SERVER_PORT=9091 23 | volumes: 24 | - ./flask:/src 25 | depends_on: 26 | - mongo 27 | 28 | mongo: 29 | image: mongo 30 | -------------------------------------------------------------------------------- /nginx-flask-mongo/flask/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder 3 | 4 | WORKDIR /src 5 | COPY requirements.txt /src 6 | RUN --mount=type=cache,target=/root/.cache/pip \ 7 | pip3 install -r requirements.txt 8 | 9 | COPY . . 10 | 11 | CMD ["python3", "server.py"] 12 | 13 | FROM builder as dev-envs 14 | 15 | RUN < /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;' 3 | -------------------------------------------------------------------------------- /official-documentation-samples/README.md: -------------------------------------------------------------------------------- 1 | # Sample apps with Compose 2 | 3 | The following samples show the various aspects of how to work with Docker 4 | Compose. As a prerequisite, be sure to [install Docker Compose](https://docs.docker.com/compose/install/) 5 | if you have not already done so. 6 | 7 | ## Key concepts these samples cover 8 | 9 | The samples should help you to: 10 | 11 | - define services based on Docker images using 12 | [Compose files](https://docs.docker.com/compose/compose-file/) `docker-compose.yml` files 13 | - understand the relationship between `docker-compose.yml` and 14 | [Dockerfiles](https://docs.docker.com/engine/reference/builder/) 15 | - learn how to make calls to your application services from Compose files 16 | 17 | ## Samples tailored to demo Compose 18 | 19 | These samples focus specifically on Docker Compose: 20 | 21 | - [Quickstart: Compose and Django](./django/README.md) - Shows how to use Docker Compose to set up and run a simple Django/PostgreSQL app. 22 | 23 | - [Quickstart: Compose and Rails](./rails/README.md) - Shows how to use 24 | Docker Compose to set up and run a Rails/PostgreSQL app. 25 | 26 | - [Quickstart: Compose and WordPress](./wordpress/README.md) - Shows how to 27 | use Docker Compose to set up and run WordPress in an isolated environment 28 | with Docker containers. 29 | -------------------------------------------------------------------------------- /official-documentation-samples/django/images/django-it-worked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/official-documentation-samples/django/images/django-it-worked.png -------------------------------------------------------------------------------- /official-documentation-samples/rails/images/rails-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/official-documentation-samples/rails/images/rails-welcome.png -------------------------------------------------------------------------------- /official-documentation-samples/wordpress/images/wordpress-lang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/official-documentation-samples/wordpress/images/wordpress-lang.png -------------------------------------------------------------------------------- /official-documentation-samples/wordpress/images/wordpress-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/official-documentation-samples/wordpress/images/wordpress-welcome.png -------------------------------------------------------------------------------- /open_in_new.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pihole-cloudflared-DoH/.env: -------------------------------------------------------------------------------- 1 | TIMEZONE=Etc/UTC 2 | PIHOLE_PW=changeit 3 | # Default values for CONDITIONAL_FORWARDING with AVM FRITZ!Box 4 | PIHOLE_ROUTER_IP=192.168.178.1 5 | PIHOLE_NETWORK_DOMAIN=fritz.box 6 | PIHOLE_REVERSE_DNS=192.168.178.0/24 7 | PIHOLE_HOST_IP=192.168.178.X 8 | PIHOLE_HOST_IPV6= 9 | -------------------------------------------------------------------------------- /plex/.env: -------------------------------------------------------------------------------- 1 | PLEX_MEDIA_PATH=/media/your/plex/path 2 | -------------------------------------------------------------------------------- /plex/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | plex: 3 | image: linuxserver/plex 4 | container_name: plex 5 | network_mode: host 6 | environment: 7 | - VERSION=docker 8 | restart: always 9 | volumes: 10 | - ${PLEX_MEDIA_PATH}:/media/ -------------------------------------------------------------------------------- /portainer/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | portainer: 3 | image: portainer/portainer-ce:alpine 4 | container_name: portainer 5 | command: -H unix:///var/run/docker.sock 6 | ports: 7 | - "9000:9000" 8 | volumes: 9 | - "/var/run/docker.sock:/var/run/docker.sock" 10 | - "portainer_data:/data" 11 | restart: always 12 | 13 | volumes: 14 | portainer_data: -------------------------------------------------------------------------------- /postgresql-pgadmin/.env: -------------------------------------------------------------------------------- 1 | POSTGRES_USER=yourUser 2 | POSTGRES_PW=changeit 3 | POSTGRES_DB=postgres 4 | PGADMIN_MAIL=your@email.com 5 | PGADMIN_PW=changeit -------------------------------------------------------------------------------- /postgresql-pgadmin/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | container_name: postgres 4 | image: postgres:latest 5 | environment: 6 | - POSTGRES_USER=${POSTGRES_USER} 7 | - POSTGRES_PASSWORD=${POSTGRES_PW} 8 | - POSTGRES_DB=${POSTGRES_DB} #optional (specify default database instead of $POSTGRES_DB) 9 | ports: 10 | - "5432:5432" 11 | restart: always 12 | 13 | pgadmin: 14 | container_name: pgadmin 15 | image: dpage/pgadmin4:latest 16 | environment: 17 | - PGADMIN_DEFAULT_EMAIL=${PGADMIN_MAIL} 18 | - PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PW} 19 | ports: 20 | - "5050:80" 21 | restart: always 22 | -------------------------------------------------------------------------------- /prometheus-grafana/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | prometheus: 3 | image: prom/prometheus 4 | container_name: prometheus 5 | command: 6 | - '--config.file=/etc/prometheus/prometheus.yml' 7 | ports: 8 | - 9090:9090 9 | restart: unless-stopped 10 | volumes: 11 | - ./prometheus:/etc/prometheus 12 | - prom_data:/prometheus 13 | grafana: 14 | image: grafana/grafana 15 | container_name: grafana 16 | ports: 17 | - 3000:3000 18 | restart: unless-stopped 19 | environment: 20 | - GF_SECURITY_ADMIN_USER=admin 21 | - GF_SECURITY_ADMIN_PASSWORD=grafana 22 | volumes: 23 | - ./grafana:/etc/grafana/provisioning/datasources 24 | volumes: 25 | prom_data: 26 | -------------------------------------------------------------------------------- /prometheus-grafana/grafana/datasource.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | datasources: 4 | - name: Prometheus 5 | type: prometheus 6 | url: http://prometheus:9090 7 | isDefault: true 8 | access: proxy 9 | editable: true 10 | -------------------------------------------------------------------------------- /prometheus-grafana/output.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/prometheus-grafana/output.jpg -------------------------------------------------------------------------------- /prometheus-grafana/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | scrape_timeout: 10s 4 | evaluation_interval: 15s 5 | alerting: 6 | alertmanagers: 7 | - static_configs: 8 | - targets: [] 9 | scheme: http 10 | timeout: 10s 11 | api_version: v1 12 | scrape_configs: 13 | - job_name: prometheus 14 | honor_timestamps: true 15 | scrape_interval: 15s 16 | scrape_timeout: 10s 17 | metrics_path: /metrics 18 | scheme: http 19 | static_configs: 20 | - targets: 21 | - localhost:9090 -------------------------------------------------------------------------------- /react-express-mongodb/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | frontend: 3 | build: 4 | context: frontend 5 | target: dev-envs 6 | ports: 7 | - 3000:3000 8 | stdin_open: true 9 | volumes: 10 | - /var/run/docker.sock:/var/run/docker.sock 11 | restart: always 12 | networks: 13 | - react-express 14 | depends_on: 15 | - backend 16 | 17 | backend: 18 | restart: always 19 | build: 20 | context: backend 21 | target: dev-envs 22 | volumes: 23 | - /var/run/docker.sock:/var/run/docker.sock 24 | depends_on: 25 | - mongo 26 | networks: 27 | - express-mongo 28 | - react-express 29 | expose: 30 | - 3000 31 | mongo: 32 | restart: always 33 | image: mongo:4.2.0 34 | volumes: 35 | - ./data:/data/db 36 | networks: 37 | - express-mongo 38 | expose: 39 | - 27017 40 | networks: 41 | react-express: 42 | express-mongo: 43 | -------------------------------------------------------------------------------- /react-express-mongodb/.gitignore: -------------------------------------------------------------------------------- 1 | frontend/node_modules/ 2 | backend/node_modules/ 3 | .idea/ 4 | data 5 | *.log 6 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM node:lts-buster-slim AS development 4 | 5 | # Create app directory 6 | WORKDIR /usr/src/app 7 | 8 | COPY package.json /usr/src/app/package.json 9 | COPY package-lock.json /usr/src/app/package-lock.json 10 | RUN npm ci 11 | 12 | COPY . /usr/src/app 13 | 14 | EXPOSE 3000 15 | 16 | CMD [ "npm", "run", "dev" ] 17 | 18 | FROM development as dev-envs 19 | RUN < { 9 | process.env[key] = envConfig[key]; 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "test":{ 3 | "PORT": 3000, 4 | "MONGODB_URI": "mongodb://mongo:27017/TodoAppTest" 5 | }, 6 | "development":{ 7 | "PORT": 3000, 8 | "MONGODB_URI": "mongodb://mongo:27017/TodoApp" 9 | } 10 | } -------------------------------------------------------------------------------- /react-express-mongodb/backend/db/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Syed Afzal 3 | */ 4 | const mongoose = require("mongoose"); 5 | 6 | exports.connect = (app) => { 7 | const options = { 8 | useNewUrlParser: true, 9 | autoIndex: false, // Don't build indexes 10 | maxPoolSize: 10, // Maintain up to 10 socket connections 11 | }; 12 | 13 | const connectWithRetry = () => { 14 | mongoose.Promise = global.Promise; 15 | console.log("MongoDB connection with retry"); 16 | mongoose 17 | .connect(process.env.MONGODB_URI, options) 18 | .then(() => { 19 | console.log("MongoDB is connected"); 20 | app.emit("ready"); 21 | }) 22 | .catch((err) => { 23 | console.log("MongoDB connection unsuccessful, retry after 2 seconds.", err); 24 | setTimeout(connectWithRetry, 2000); 25 | }); 26 | }; 27 | connectWithRetry(); 28 | }; 29 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/logs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mongodb/backend/logs/.gitkeep -------------------------------------------------------------------------------- /react-express-mongodb/backend/models/todos/todo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Syed Afzal 3 | */ 4 | const mongoose = require('mongoose'); 5 | 6 | const Todo = mongoose.model('Todo', { 7 | text : { 8 | type: String, 9 | trim: true, 10 | required: true 11 | } 12 | }); 13 | 14 | module.exports = {Todo}; 15 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docker_node_mongo_starter", 3 | "version": "1.0.0", 4 | "description": "docker starter with node js and mongodb services", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node server.js", 8 | "format": "prettier --write {**/,}*.js", 9 | "lint": "prettier --check {**/,}*.js", 10 | "dev": "nodemon server.js" 11 | }, 12 | "author": "Syed Afzal", 13 | "license": "ISC", 14 | "dependencies": { 15 | "bcryptjs": "^2.4.3", 16 | "body-parser": "^1.18.2", 17 | "cookie-parser": "^1.4.4", 18 | "cors": "^2.8.4", 19 | "express": "^4.17.1", 20 | "lodash": "^4.17.13", 21 | "mongodb": "^3.0.7", 22 | "mongoose": "^6.0.9", 23 | "simple-node-logger": "^18.12.23", 24 | "validator": "^13.7.0" 25 | }, 26 | "devDependencies": { 27 | "nodemon": "^2.0.3", 28 | "prettier": "^2.0.5" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const serverResponses = require("../utils/helpers/responses"); 3 | const messages = require("../config/messages"); 4 | const { Todo } = require("../models/todos/todo"); 5 | 6 | const routes = (app) => { 7 | const router = express.Router(); 8 | 9 | router.post("/todos", (req, res) => { 10 | const todo = new Todo({ 11 | text: req.body.text, 12 | }); 13 | 14 | todo 15 | .save() 16 | .then((result) => { 17 | serverResponses.sendSuccess(res, messages.SUCCESSFUL, result); 18 | }) 19 | .catch((e) => { 20 | serverResponses.sendError(res, messages.BAD_REQUEST, e); 21 | }); 22 | }); 23 | 24 | router.get("/", (req, res) => { 25 | Todo.find({}, { __v: 0 }) 26 | .then((todos) => { 27 | serverResponses.sendSuccess(res, messages.SUCCESSFUL, todos); 28 | }) 29 | .catch((e) => { 30 | serverResponses.sendError(res, messages.BAD_REQUEST, e); 31 | }); 32 | }); 33 | 34 | //it's a prefix before api it is useful when you have many modules and you want to 35 | //differentiate b/w each module you can use this technique 36 | app.use("/api", router); 37 | }; 38 | module.exports = routes; 39 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Syed Afzal 3 | */ 4 | require("./config/config"); 5 | 6 | const express = require("express"); 7 | const path = require("path"); 8 | const cookieParser = require("cookie-parser"); 9 | const bodyParser = require("body-parser"); 10 | const cors = require("cors"); 11 | const db = require("./db"); 12 | 13 | const app = express(); 14 | 15 | //connection from db here 16 | db.connect(app); 17 | 18 | app.use(cors()); 19 | app.use(bodyParser.json()); 20 | app.use(bodyParser.urlencoded({ extended: false })); 21 | app.use(cookieParser()); 22 | app.use(express.static(path.join(__dirname, "public"))); 23 | 24 | // adding routes 25 | require("./routes")(app); 26 | 27 | app.on("ready", () => { 28 | app.listen(3000, () => { 29 | console.log("Server is up on port", 3000); 30 | }); 31 | }); 32 | 33 | module.exports = app; 34 | -------------------------------------------------------------------------------- /react-express-mongodb/backend/utils/helpers/logger.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const filename = path.join(__dirname, '../../logs/project.log'); 3 | 4 | //you can change format according to you 5 | const log = require('simple-node-logger').createSimpleLogger( { 6 | logFilePath:filename, 7 | timestampFormat:'YYYY-MM-DD HH:mm:ss'} 8 | ); 9 | module.exports = {log}; -------------------------------------------------------------------------------- /react-express-mongodb/backend/utils/helpers/responses.js: -------------------------------------------------------------------------------- 1 | const serverResponse = { 2 | sendSuccess: (res, message, data = null) => { 3 | const responseMessage = { 4 | code: message.code ? message.code : 500, 5 | success: message.success, 6 | message: message.message, 7 | }; 8 | if (data) { responseMessage.data = data; } 9 | return res.status(message.code).json(responseMessage); 10 | }, 11 | sendError: (res, error) => { 12 | const responseMessage = { 13 | code: error.code ? error.code : 500, 14 | success: false, 15 | message: error.message, 16 | }; 17 | return res.status(error.code ? error.code : 500).json(responseMessage); 18 | }, 19 | }; 20 | 21 | module.exports = serverResponse; -------------------------------------------------------------------------------- /react-express-mongodb/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | frontend: 3 | build: 4 | context: frontend 5 | target: development 6 | ports: 7 | - 3000:3000 8 | stdin_open: true 9 | volumes: 10 | - ./frontend:/usr/src/app 11 | - /usr/src/app/node_modules 12 | restart: always 13 | networks: 14 | - react-express 15 | depends_on: 16 | - backend 17 | 18 | backend: 19 | restart: always 20 | build: 21 | context: backend 22 | target: development 23 | volumes: 24 | - ./backend:/usr/src/app 25 | - /usr/src/app/node_modules 26 | depends_on: 27 | - mongo 28 | networks: 29 | - express-mongo 30 | - react-express 31 | expose: 32 | - 3000 33 | mongo: 34 | restart: always 35 | image: mongo:4.2.0 36 | volumes: 37 | - ./data:/data/db 38 | networks: 39 | - express-mongo 40 | expose: 41 | - 27017 42 | networks: 43 | react-express: 44 | express-mongo: 45 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .idea 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | # Create image based on the official Node image from dockerhub 4 | FROM node:lts-buster AS development 5 | 6 | # Create app directory 7 | WORKDIR /usr/src/app 8 | 9 | # Copy dependency definitions 10 | COPY package.json /usr/src/app 11 | COPY package-lock.json /usr/src/app 12 | 13 | # Install dependecies 14 | #RUN npm set progress=false \ 15 | # && npm config set depth 0 \ 16 | # && npm i install 17 | RUN npm ci 18 | 19 | # Get all the code needed to run the app 20 | COPY . /usr/src/app 21 | 22 | # Expose the port the app runs in 23 | EXPOSE 3000 24 | 25 | # Serve the app 26 | CMD ["npm", "start"] 27 | 28 | FROM development as dev-envs 29 | RUN <0.2%", 34 | "not dead", 35 | "not op_mini all" 36 | ], 37 | "development": [ 38 | "last 1 chrome version", 39 | "last 1 firefox version", 40 | "last 1 safari version" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mongodb/frontend/public/favicon.ico -------------------------------------------------------------------------------- /react-express-mongodb/frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mongodb/frontend/public/logo192.png -------------------------------------------------------------------------------- /react-express-mongodb/frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mongodb/frontend/public/logo512.png -------------------------------------------------------------------------------- /react-express-mongodb/frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/App.scss: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | .todo-app { 5 | background-color: #efefef; 6 | padding: 1.2em; 7 | .new-todo{ 8 | display: flex; 9 | justify-content: space-between; 10 | align-items: center; 11 | input{ 12 | width: 80% !important; 13 | } 14 | } 15 | } 16 | 17 | //.list-group-item{ 18 | // &.active:hover{ 19 | // 20 | // } 21 | // &active:hover{ 22 | // background-color: #d3d3d3; 23 | // } 24 | //} -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/components/AddTodo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default class AddTodo extends React.Component { 4 | handleSubmit = (e) => { 5 | e.preventDefault(); 6 | const { value } = e.target.elements.value; 7 | if (value.length > 0) { 8 | this.props.handleAddTodo(value); 9 | e.target.reset(); 10 | } 11 | }; 12 | 13 | render() { 14 | return ( 15 |
20 | 27 | 30 |
31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/components/TodoList.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default class TodoList extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | 7 | this.state = { 8 | activeIndex: 0, 9 | }; 10 | } 11 | 12 | handleActive(index) { 13 | this.setState({ 14 | activeIndex: index, 15 | }); 16 | } 17 | 18 | renderTodos(todos) { 19 | return ( 20 |
    21 | {todos.map((todo, i) => ( 22 |
  • { 29 | this.handleActive(i); 30 | }} 31 | > 32 | {todo.text} 33 |
  • 34 | ))} 35 |
36 | ); 37 | } 38 | 39 | render() { 40 | let { todos } = this.props; 41 | return todos.length > 0 ? ( 42 | this.renderTodos(todos) 43 | ) : ( 44 |
45 | No Todos to display 46 |
47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/custom.scss: -------------------------------------------------------------------------------- 1 | // Override default variables before the import 2 | $body-bg: #fff; 3 | // Import Bootstrap and its default variables 4 | @import '~bootstrap/scss/bootstrap.scss'; 5 | 6 | .cursor-pointer { 7 | cursor: pointer; 8 | } -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /react-express-mongodb/frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | 7 | import './custom.scss'; 8 | 9 | ReactDOM.render(, document.getElementById('root')); 10 | 11 | // If you want your app to work offline and load faster, you can change 12 | // unregister() to register() below. Note this comes with some pitfalls. 13 | // Learn more about service workers: https://bit.ly/CRA-PWA 14 | serviceWorker.unregister(); 15 | -------------------------------------------------------------------------------- /react-express-mongodb/output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mongodb/output.png -------------------------------------------------------------------------------- /react-express-mysql/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /react-express-mysql/backend/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015-2017 Bret Fisher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /react-express-mysql/backend/healthcheck.js: -------------------------------------------------------------------------------- 1 | const http = require("http"); 2 | 3 | const options = { 4 | timeout: 2000, 5 | host: "localhost", 6 | port: process.env.PORT || 8080, 7 | path: "/healthz" // must be the same as HEALTHCHECK in Dockerfile 8 | }; 9 | 10 | const request = http.request(options, res => { 11 | console.info("STATUS: " + res.statusCode); 12 | process.exitCode = res.statusCode === 200 ? 0 : 1; 13 | process.exit(); 14 | }); 15 | 16 | request.on("error", function(err) { 17 | console.error("ERROR", err); 18 | process.exit(1); 19 | }); 20 | 21 | request.end(); 22 | -------------------------------------------------------------------------------- /react-express-mysql/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-docker-good-defaults", 3 | "private": true, 4 | "version": "2.0.1", 5 | "description": "Node.js Hello world app using docker features for easy docker compose local dev and solid production defaults", 6 | "author": "Bret Fisher ", 7 | "main": "src/index.js", 8 | "scripts": { 9 | "start": "node src/index.js", 10 | "start-watch": "nodemon src/index.js --inspect=0.0.0.0:9229", 11 | "start-wait-debuger": "nodemon src/index.js --inspect-brk=0.0.0.0:9229", 12 | "test": "cross-env NODE_ENV=test PORT=8081 mocha --timeout 10000 --exit --inspect=0.0.0.0:9230", 13 | "test-watch": "nodemon --exec \"npm test\"", 14 | "test-wait-debuger": "cross-env NODE_ENV=test PORT=8081 mocha --no-timeouts --exit --inspect-brk=0.0.0.0:9230" 15 | }, 16 | "dependencies": { 17 | "express": "^4.17.1", 18 | "knex": "^0.95.11", 19 | "morgan": "^1.10.0", 20 | "mysql2": "^2.1.0" 21 | }, 22 | "devDependencies": { 23 | "chai": "^4.2.0", 24 | "chai-http": "^4.3.0", 25 | "cross-env": "^7.0.2", 26 | "mocha": "^9.2.2", 27 | "nodemon": "^2.0.4" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /react-express-mysql/backend/src/config.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | 3 | const readFileSync = filename => fs.readFileSync(filename).toString("utf8"); 4 | 5 | // Constants 6 | module.exports = { 7 | database: { 8 | host: process.env.DATABASE_HOST || "localhost", 9 | port: process.env.DATABASE_PORT, 10 | database: process.env.DATABASE_DB, 11 | user: process.env.DATABASE_USER, 12 | password: process.env.DATABASE_PASSWORD 13 | ? readFileSync(process.env.DATABASE_PASSWORD) 14 | : null 15 | }, 16 | port: process.env.PORT || 8080 17 | // if you're not using docker compose for local development, this will default to 8080 18 | // to prevent non-root permission problems with 80. Dockerfile is set to make this 80 19 | // because containers don't have that issue :) 20 | }; 21 | -------------------------------------------------------------------------------- /react-express-mysql/backend/src/database.js: -------------------------------------------------------------------------------- 1 | const knex = require('knex'); 2 | const { database } = require('./config'); 3 | 4 | module.exports = knex({ 5 | client: 'mysql2', 6 | connection: database, 7 | }); 8 | -------------------------------------------------------------------------------- /react-express-mysql/backend/src/server.js: -------------------------------------------------------------------------------- 1 | // simple node web server that displays hello world 2 | // optimized for Docker image 3 | 4 | const express = require("express"); 5 | // this example uses express web framework so we know what longer build times 6 | // do and how Dockerfile layer ordering matters. If you mess up Dockerfile ordering 7 | // you'll see long build times on every code change + build. If done correctly, 8 | // code changes should be only a few seconds to build locally due to build cache. 9 | 10 | const morgan = require("morgan"); 11 | // morgan provides easy logging for express, and by default it logs to stdout 12 | // which is a best practice in Docker. Friends don't let friends code their apps to 13 | // do app logging to files in containers. 14 | 15 | const database = require("./database"); 16 | 17 | // Appi 18 | const app = express(); 19 | 20 | app.use(morgan("common")); 21 | 22 | app.get("/", function(req, res, next) { 23 | database.raw('select VERSION() version') 24 | .then(([rows, columns]) => rows[0]) 25 | .then((row) => res.json({ message: `Hello from MySQL ${row.version}` })) 26 | .catch(next); 27 | }); 28 | 29 | app.get("/healthz", function(req, res) { 30 | // do app logic here to determine if app is truly healthy 31 | // you should return 200 if healthy, and anything else will fail 32 | // if you want, you should be able to restrict this to localhost (include ipv4 and ipv6) 33 | res.send("I am happy and healthy\n"); 34 | }); 35 | 36 | module.exports = app; 37 | -------------------------------------------------------------------------------- /react-express-mysql/backend/test/sample.js: -------------------------------------------------------------------------------- 1 | const chai = require("chai"); 2 | const chaiHttp = require("chai-http"); 3 | 4 | const app = require("../src/server"); 5 | 6 | chai.use(chaiHttp); 7 | chai.should(); 8 | 9 | describe("API /healthz", () => { 10 | it("it should return 200", done => { 11 | chai 12 | .request(app) 13 | .get("/healthz") 14 | .end((err, res) => { 15 | res.should.have.status(200); 16 | done(); 17 | }); 18 | }); 19 | }); 20 | 21 | describe("API /", () => { 22 | it("it should return Welcome message", done => { 23 | chai 24 | .request(app) 25 | .get("/") 26 | .end((err, res) => { 27 | res.should.have.status(200); 28 | res.should.to.be.html; 29 | res.text.should.be.equal("Hello Docker World\n"); 30 | done(); 31 | }); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /react-express-mysql/db/password.txt: -------------------------------------------------------------------------------- 1 | db-btf5q -------------------------------------------------------------------------------- /react-express-mysql/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM node:lts AS development 4 | 5 | ENV CI=true 6 | ENV PORT=3000 7 | 8 | WORKDIR /code 9 | COPY package.json /code/package.json 10 | COPY package-lock.json /code/package-lock.json 11 | RUN npm ci 12 | COPY . /code 13 | 14 | CMD [ "npm", "start" ] 15 | 16 | FROM development AS builder 17 | 18 | RUN npm run build 19 | 20 | FROM development as dev-envs 21 | RUN <0.2%", 21 | "not dead", 22 | "not op_mini all" 23 | ], 24 | "development": [ 25 | "last 1 chrome version", 26 | "last 1 firefox version", 27 | "last 1 safari version" 28 | ] 29 | }, 30 | "devDependencies": { 31 | "@testing-library/jest-dom": "^5.15.0", 32 | "@testing-library/react": "^12.1.2", 33 | "@testing-library/user-event": "^13.5.0", 34 | "http-proxy-middleware": "^2.0.1", 35 | "react-scripts": "^5.0.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mysql/frontend/public/favicon.ico -------------------------------------------------------------------------------- /react-express-mysql/frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mysql/frontend/public/logo192.png -------------------------------------------------------------------------------- /react-express-mysql/frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mysql/frontend/public/logo512.png -------------------------------------------------------------------------------- /react-express-mysql/frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import logo from "./logo.svg"; 3 | import "./App.css"; 4 | 5 | function App() { 6 | const [message, setMessage] = useState(); 7 | useEffect(() => { 8 | fetch("/api/") 9 | .then(res => res.json()) 10 | .then(res => setMessage(res.message)) 11 | .catch(console.error); 12 | }, [setMessage]); 13 | return ( 14 |
15 |
16 | logo 17 |

{message || "Loading..."}

18 |

19 | Edit src/App.js and save to reload. 20 |

21 | 27 | Learn React 28 | 29 |
30 |
31 | ); 32 | } 33 | 34 | export default App; 35 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want your app to work offline and load faster, you can change 15 | // unregister() to register() below. Note this comes with some pitfalls. 16 | // Learn more about service workers: https://bit.ly/CRA-PWA 17 | serviceWorker.unregister(); 18 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | const { createProxyMiddleware } = require("http-proxy-middleware"); 2 | 3 | module.exports = function(app) { 4 | app.use( 5 | "/api", 6 | createProxyMiddleware({ 7 | target: "http://backend", 8 | pathRewrite: { "^/api": "" } 9 | }) 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /react-express-mysql/frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /react-express-mysql/output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-express-mysql/output.png -------------------------------------------------------------------------------- /react-java-mysql/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM maven:3.8.5-eclipse-temurin-17 AS builder 4 | WORKDIR /workdir/server 5 | COPY pom.xml /workdir/server/pom.xml 6 | RUN mvn dependency:go-offline 7 | 8 | COPY src /workdir/server/src 9 | RUN mvn install 10 | 11 | FROM builder as dev-envs 12 | 13 | RUN < { 9 | } -------------------------------------------------------------------------------- /react-java-mysql/backend/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor=com.company.project.configuration.DockerSecretsProcessor 2 | -------------------------------------------------------------------------------- /react-java-mysql/backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL8Dialect 2 | spring.jpa.hibernate.ddl-auto=none 3 | spring.jpa.hibernate.show-sql=true 4 | 5 | 6 | spring.datasource.url=jdbc:mysql://${MYSQL_HOST:db}:3306/example 7 | spring.datasource.username=root 8 | spring.datasource.password=${MYSQL_PASSWORD:db-57xsl} 9 | spring.datasource.initialization-mode=always 10 | spring.datasource.initialize=true 11 | spring.datasource.schema=classpath:/schema.sql 12 | spring.datasource.continue-on-error=true 13 | -------------------------------------------------------------------------------- /react-java-mysql/backend/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO example.greetings(name) values ('Docker'); 2 | -------------------------------------------------------------------------------- /react-java-mysql/backend/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS example.greetings ( 2 | id INTEGER AUTO_INCREMENT, 3 | name varchar(50) NOT NULL, 4 | PRIMARY KEY (id) 5 | ); 6 | -------------------------------------------------------------------------------- /react-java-mysql/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | backend: 3 | build: backend 4 | restart: always 5 | secrets: 6 | - db-password 7 | environment: 8 | MYSQL_HOST: db 9 | networks: 10 | - react-spring 11 | - spring-mysql 12 | depends_on: 13 | db: 14 | condition: service_healthy 15 | db: 16 | # We use a mariadb image which supports both amd64 & arm64 architecture 17 | image: mariadb:10.6.4-focal 18 | # If you really want to use MySQL, uncomment the following line 19 | #image: mysql:8.0.19 20 | environment: 21 | - MYSQL_DATABASE=example 22 | - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password 23 | restart: always 24 | healthcheck: 25 | test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"] 26 | interval: 3s 27 | retries: 5 28 | start_period: 30s 29 | secrets: 30 | - db-password 31 | volumes: 32 | - db-data:/var/lib/mysql 33 | networks: 34 | - spring-mysql 35 | frontend: 36 | build: 37 | context: frontend 38 | target: development 39 | ports: 40 | - 3000:3000 41 | volumes: 42 | - ./frontend/src:/code/src 43 | - /project/node_modules 44 | networks: 45 | - react-spring 46 | depends_on: 47 | - backend 48 | expose: 49 | - 3306 50 | - 33060 51 | volumes: 52 | db-data: {} 53 | secrets: 54 | db-password: 55 | file: db/password.txt 56 | networks: 57 | react-spring: {} 58 | spring-mysql: {} 59 | -------------------------------------------------------------------------------- /react-java-mysql/db/password.txt: -------------------------------------------------------------------------------- 1 | db-57xsl -------------------------------------------------------------------------------- /react-java-mysql/frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM node:lts AS development 4 | 5 | WORKDIR /code 6 | COPY package.json /code/package.json 7 | COPY package-lock.json /code/package-lock.json 8 | 9 | RUN npm ci 10 | COPY . /code 11 | 12 | ENV CI=true 13 | ENV PORT=3000 14 | 15 | CMD [ "npm", "start" ] 16 | 17 | FROM development AS dev-envs 18 | RUN <0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | }, 38 | "devDependencies": { 39 | "http-proxy-middleware": "^2.0.1", 40 | "react-scripts": "^5.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-java-mysql/frontend/public/favicon.ico -------------------------------------------------------------------------------- /react-java-mysql/frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-java-mysql/frontend/public/logo192.png -------------------------------------------------------------------------------- /react-java-mysql/frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-java-mysql/frontend/public/logo512.png -------------------------------------------------------------------------------- /react-java-mysql/frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import logo from "./logo.svg"; 3 | import "./App.css"; 4 | 5 | type Greeting = { 6 | id: number; 7 | name: string; 8 | }; 9 | 10 | function App() { 11 | const [greeting, setGreeting] = useState(); 12 | useEffect(() => { 13 | fetch("/api") 14 | .then(res => res.json()) 15 | .then(setGreeting) 16 | .catch(console.error); 17 | }, [setGreeting]); 18 | return ( 19 |
20 |
21 | logo 22 | {greeting ? ( 23 |

Hello from {greeting.name}

24 | ) : ( 25 |

Loading...

26 | )} 27 |

28 | Edit src/App.tsx and save to reload. 29 |

30 | 36 | Learn React 37 | 38 |
39 |
40 | ); 41 | } 42 | 43 | export default App; 44 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want your app to work offline and load faster, you can change 15 | // unregister() to register() below. Note this comes with some pitfalls. 16 | // Learn more about service workers: https://bit.ly/CRA-PWA 17 | serviceWorker.unregister(); 18 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | const { createProxyMiddleware } = require("http-proxy-middleware"); 2 | 3 | module.exports = function(app) { 4 | app.use( 5 | "/api", 6 | createProxyMiddleware({ 7 | target: "http://backend:8080", 8 | pathRewrite: { "^/api": "" } 9 | }) 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /react-java-mysql/frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "noEmit": true, 20 | "jsx": "react" 21 | }, 22 | "include": [ 23 | "src" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /react-java-mysql/output.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-java-mysql/output.jpg -------------------------------------------------------------------------------- /react-nginx/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | frontend: 3 | build: 4 | context: . 5 | target: dev-envs 6 | container_name: frontend 7 | ports: 8 | - "80:3000" 9 | - "3000:3000" 10 | volumes: 11 | - /var/run/docker.sock:/var/run/docker.sock 12 | -------------------------------------------------------------------------------- /react-nginx/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | build 4 | .dockerignore 5 | **/.git 6 | **/.DS_Store 7 | **/node_modules 8 | -------------------------------------------------------------------------------- /react-nginx/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build -------------------------------------------------------------------------------- /react-nginx/.nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | 5 | location / { 6 | root /usr/share/nginx/html; 7 | index index.html index.htm; 8 | try_files $uri /index.html =404; 9 | } 10 | 11 | error_page 500 502 503 504 /50x.html; 12 | 13 | location = /50x.html { 14 | root /usr/share/nginx/html; 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /react-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | # 1. For build React app 4 | FROM node:lts AS development 5 | 6 | # Set working directory 7 | WORKDIR /app 8 | 9 | # 10 | COPY package.json /app/package.json 11 | COPY package-lock.json /app/package-lock.json 12 | 13 | # Same as npm install 14 | RUN npm ci 15 | 16 | COPY . /app 17 | 18 | ENV CI=true 19 | ENV PORT=3000 20 | 21 | CMD [ "npm", "start" ] 22 | 23 | FROM development AS build 24 | 25 | RUN npm run build 26 | 27 | 28 | FROM development as dev-envs 29 | RUN <0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /react-nginx/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-nginx/public/favicon.ico -------------------------------------------------------------------------------- /react-nginx/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-nginx/public/logo192.png -------------------------------------------------------------------------------- /react-nginx/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-nginx/public/logo512.png -------------------------------------------------------------------------------- /react-nginx/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react-nginx/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-nginx/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /react-nginx/src/App.js: -------------------------------------------------------------------------------- 1 | import logo from './logo.svg'; 2 | import './App.css'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | logo 9 |

10 | Edit src/App.js and save to reload. 11 |

12 | 18 | Learn React 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /react-nginx/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /react-nginx/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /react-nginx/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /react-nginx/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /react-nginx/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /react-rust-postgres/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | name: react-rust-postgres 2 | services: 3 | frontend: 4 | build: 5 | context: ../frontend 6 | target: dev-envs 7 | networks: 8 | - client-side 9 | ports: 10 | - 3000:3000 11 | volumes: 12 | - /var/run/docker.sock:/var/run/docker.sock 13 | 14 | backend: 15 | build: 16 | context: ../backend 17 | target: dev-envs 18 | environment: 19 | - RUST_LOG=debug 20 | - PG_DBNAME=postgres 21 | - PG_HOST=db 22 | - PG_USER=postgres 23 | - PG_PASSWORD=mysecretpassword 24 | - ADDRESS=0.0.0.0:8000 25 | networks: 26 | - client-side 27 | - server-side 28 | volumes: 29 | - /var/run/docker.sock:/var/run/docker.sock 30 | depends_on: 31 | - db 32 | 33 | db: 34 | image: postgres:12-alpine 35 | restart: always 36 | environment: 37 | - POSTGRES_PASSWORD=mysecretpassword 38 | networks: 39 | - server-side 40 | ports: 41 | - 5432:5432 42 | volumes: 43 | - db-data:/var/lib/postgresql/data 44 | 45 | networks: 46 | client-side: {} 47 | server-side: {} 48 | 49 | volumes: 50 | backend-cache: {} 51 | db-data: {} 52 | -------------------------------------------------------------------------------- /react-rust-postgres/backend/.dockerignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /react-rust-postgres/backend/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /react-rust-postgres/backend/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "react-rust-postgres" 3 | version = "0.1.0" 4 | authors = ["Jérémie Drouet "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | actix-web = "4.0.0-beta.8" 11 | deadpool-postgres = "0.9.0" 12 | env_logger = "^0.8" 13 | log = "^0.4" 14 | serde = "1.0" 15 | serde_json = "1.0" 16 | tokio-postgres = "^0.7" 17 | tokio-postgres-migration = "^0.1" 18 | -------------------------------------------------------------------------------- /react-rust-postgres/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | FROM rust:buster AS base 3 | 4 | ENV USER=root 5 | ENV ROCKET_ADDRESS=0.0.0.0 6 | ENV ROCKET_ENV=development 7 | 8 | WORKDIR /code 9 | RUN cargo init 10 | COPY Cargo.toml /code/Cargo.toml 11 | RUN cargo fetch 12 | COPY . /code 13 | 14 | FROM base AS development 15 | 16 | EXPOSE 8000 17 | 18 | CMD [ "cargo", "run", "--offline" ] 19 | 20 | FROM base AS dev-envs 21 | 22 | EXPOSE 8000 23 | RUN <) -> HttpResponse { 9 | let client = match pool.get().await { 10 | Ok(client) => client, 11 | Err(err) => { 12 | log::debug!("unable to get postgres client: {:?}", err); 13 | return HttpResponse::InternalServerError().json("unable to get postgres client"); 14 | } 15 | }; 16 | match user::User::all(&**client).await { 17 | Ok(list) => HttpResponse::Ok().json(list), 18 | Err(err) => { 19 | log::debug!("unable to fetch users: {:?}", err); 20 | return HttpResponse::InternalServerError().json("unable to fetch users"); 21 | } 22 | } 23 | } 24 | 25 | fn address() -> String { 26 | std::env::var("ADDRESS").unwrap_or_else(|_| "127.0.0.1:8000".into()) 27 | } 28 | 29 | #[actix_web::main] 30 | async fn main() -> std::io::Result<()> { 31 | env_logger::init(); 32 | 33 | let pg_pool = postgres::create_pool(); 34 | postgres::migrate_up(&pg_pool).await; 35 | 36 | let address = address(); 37 | HttpServer::new(move || { 38 | App::new() 39 | .app_data(web::Data::new(pg_pool.clone())) 40 | .service(list_users) 41 | }) 42 | .bind(&address)? 43 | .run() 44 | .await 45 | } 46 | -------------------------------------------------------------------------------- /react-rust-postgres/backend/src/postgres.rs: -------------------------------------------------------------------------------- 1 | use deadpool_postgres::{Config, Pool}; 2 | use tokio_postgres::NoTls; 3 | use tokio_postgres_migration::Migration; 4 | 5 | const SCRIPTS_UP: [(&str, &str); 1] = [( 6 | "0001_create-users", 7 | include_str!("../migrations/0001_create-users_up.sql"), 8 | )]; 9 | 10 | fn create_config() -> Config { 11 | let mut cfg = Config::new(); 12 | if let Ok(host) = std::env::var("PG_HOST") { 13 | cfg.host = Some(host); 14 | } 15 | if let Ok(dbname) = std::env::var("PG_DBNAME") { 16 | cfg.dbname = Some(dbname); 17 | } 18 | if let Ok(user) = std::env::var("PG_USER") { 19 | cfg.user = Some(user); 20 | } 21 | if let Ok(password) = std::env::var("PG_PASSWORD") { 22 | cfg.password = Some(password); 23 | } 24 | cfg 25 | } 26 | 27 | pub fn create_pool() -> Pool { 28 | create_config() 29 | .create_pool(NoTls) 30 | .expect("couldn't create postgres pool") 31 | } 32 | 33 | pub async fn migrate_up(pool: &Pool) { 34 | let mut client = pool.get().await.expect("couldn't get postgres client"); 35 | let migration = Migration::new("migrations".to_string()); 36 | migration 37 | .up(&mut **client, &SCRIPTS_UP) 38 | .await 39 | .expect("couldn't run migrations"); 40 | } 41 | -------------------------------------------------------------------------------- /react-rust-postgres/backend/src/user.rs: -------------------------------------------------------------------------------- 1 | use tokio_postgres::{Error, GenericClient, Row}; 2 | 3 | #[derive(Debug, serde::Serialize)] 4 | pub struct User { 5 | pub id: i32, 6 | pub login: String, 7 | } 8 | 9 | impl From for User { 10 | fn from(row: Row) -> Self { 11 | Self { 12 | id: row.get(0), 13 | login: row.get(1), 14 | } 15 | } 16 | } 17 | 18 | impl User { 19 | pub async fn all(client: &C) -> Result, Error> { 20 | let stmt = client.prepare("SELECT id, login FROM users").await?; 21 | let rows = client.query(&stmt, &[]).await?; 22 | 23 | Ok(rows.into_iter().map(User::from).collect()) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /react-rust-postgres/capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-rust-postgres/capture.png -------------------------------------------------------------------------------- /react-rust-postgres/compose.yaml: -------------------------------------------------------------------------------- 1 | name: react-rust-postgres 2 | services: 3 | frontend: 4 | build: 5 | context: frontend 6 | target: development 7 | networks: 8 | - client-side 9 | ports: 10 | - 3000:3000 11 | volumes: 12 | - ./frontend/src:/code/src:ro 13 | 14 | backend: 15 | build: 16 | context: backend 17 | target: development 18 | environment: 19 | - ADDRESS=0.0.0.0:8000 20 | - RUST_LOG=debug 21 | - PG_DBNAME=postgres 22 | - PG_HOST=db 23 | - PG_USER=postgres 24 | - PG_PASSWORD=mysecretpassword 25 | networks: 26 | - client-side 27 | - server-side 28 | volumes: 29 | - ./backend/src:/code/src 30 | - backend-cache:/code/target 31 | depends_on: 32 | - db 33 | 34 | db: 35 | image: postgres:12-alpine 36 | restart: always 37 | environment: 38 | - POSTGRES_PASSWORD=mysecretpassword 39 | networks: 40 | - server-side 41 | ports: 42 | - 5432:5432 43 | volumes: 44 | - db-data:/var/lib/postgresql/data 45 | 46 | networks: 47 | client-side: {} 48 | server-side: {} 49 | 50 | volumes: 51 | backend-cache: {} 52 | db-data: {} 53 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | FROM node:lts AS development 3 | 4 | ENV CI=true 5 | ENV PORT=3000 6 | 7 | WORKDIR /code 8 | COPY package.json /code/package.json 9 | COPY package-lock.json /code/package-lock.json 10 | RUN npm ci 11 | COPY . /code 12 | 13 | CMD [ "npm", "start" ] 14 | 15 | FROM development as dev-envs 16 | RUN <0.2%", 25 | "not dead", 26 | "not op_mini all" 27 | ], 28 | "development": [ 29 | "last 1 chrome version", 30 | "last 1 firefox version", 31 | "last 1 safari version" 32 | ] 33 | }, 34 | "devDependencies": { 35 | "http-proxy-middleware": "^1.0.3" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-rust-postgres/frontend/public/favicon.ico -------------------------------------------------------------------------------- /react-rust-postgres/frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-rust-postgres/frontend/public/logo192.png -------------------------------------------------------------------------------- /react-rust-postgres/frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/react-rust-postgres/frontend/public/logo512.png -------------------------------------------------------------------------------- /react-rust-postgres/frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import logo from "./logo.svg"; 3 | import "./App.css"; 4 | 5 | function App() { 6 | const [message, setMessage] = useState(); 7 | useEffect(() => { 8 | fetch("/api/users") 9 | .then((res) => res.json()) 10 | .then((res) => setMessage(`Hello with ${res.length} users`)) 11 | .catch(console.error); 12 | }, [setMessage]); 13 | return ( 14 |
15 |
16 | logo 17 |

{message || "Loading..."}

18 |

19 | Edit src/App.js and save to reload. 20 |

21 | 27 | Learn React 28 | 29 |
30 |
31 | ); 32 | } 33 | 34 | export default App; 35 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want your app to work offline and load faster, you can change 15 | // unregister() to register() below. Note this comes with some pitfalls. 16 | // Learn more about service workers: https://bit.ly/CRA-PWA 17 | serviceWorker.unregister(); 18 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | const { createProxyMiddleware } = require("http-proxy-middleware"); 2 | 3 | module.exports = function(app) { 4 | app.use( 5 | "/api", 6 | createProxyMiddleware({ 7 | target: "http://backend:8000", 8 | pathRewrite: { "^/api": "" } 9 | }) 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /react-rust-postgres/frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /sparkjava-mysql/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | backend: 3 | build: 4 | context: backend 5 | target: dev-envs 6 | ports: 7 | - 8080:8080 8 | secrets: 9 | - db-password 10 | volumes: 11 | - /var/run/docker.sock:/var/run/docker.sock 12 | db: 13 | # We use a mariadb image which supports both amd64 & arm64 architecture 14 | image: mariadb:10.6.4-focal 15 | # If you really want to use MySQL, uncomment the following line 16 | #image: mysql:8.0.27 17 | restart: always 18 | secrets: 19 | - db-password 20 | volumes: 21 | - db-data:/var/lib/mysql 22 | environment: 23 | - MYSQL_DATABASE=example 24 | - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password 25 | expose: 26 | - 3306 27 | - 33060 28 | volumes: 29 | db-data: 30 | secrets: 31 | db-password: 32 | file: db/password.txt 33 | -------------------------------------------------------------------------------- /sparkjava-mysql/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM maven:3.8.5-eclipse-temurin-17 AS build 4 | WORKDIR /workdir/server 5 | COPY pom.xml /workdir/server/pom.xml 6 | RUN mvn dependency:go-offline 7 | 8 | COPY src /workdir/server/src 9 | 10 | RUN mvn --batch-mode clean compile assembly:single 11 | 12 | FROM build AS dev-envs 13 | RUN < "Hello from Docker!"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-postgres/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | backend: 3 | build: 4 | context: backend 5 | target: dev-envs 6 | ports: 7 | - 8080:8080 8 | environment: 9 | - POSTGRES_DB=example 10 | networks: 11 | - spring-postgres 12 | volumes: 13 | - /var/run/docker.sock:/var/run/docker.sock 14 | db: 15 | image: postgres 16 | restart: always 17 | secrets: 18 | - db-password 19 | volumes: 20 | - db-data:/var/lib/postgresql/data 21 | networks: 22 | - spring-postgres 23 | environment: 24 | - POSTGRES_DB=example 25 | - POSTGRES_PASSWORD_FILE=/run/secrets/db-password 26 | expose: 27 | - 5432 28 | volumes: 29 | db-data: 30 | secrets: 31 | db-password: 32 | file: db/password.txt 33 | networks: 34 | spring-postgres: 35 | -------------------------------------------------------------------------------- /spring-postgres/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM maven:3.8.5-eclipse-temurin-17 AS builder 4 | WORKDIR /workdir/server 5 | COPY pom.xml /workdir/server/pom.xml 6 | RUN mvn dependency:go-offline 7 | 8 | COPY src /workdir/server/src 9 | RUN mvn install 10 | 11 | FROM builder AS dev-envs 12 | RUN < { 9 | } 10 | -------------------------------------------------------------------------------- /spring-postgres/backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=none 3 | spring.jpa.hibernate.show-sql=true 4 | 5 | spring.datasource.url=jdbc:postgresql://db:5432/${POSTGRES_DB} 6 | spring.datasource.username=postgres 7 | spring.datasource.password=${POSTGRES_PASSWORD:db-wrz2z} 8 | spring.datasource.initialization-mode=always 9 | spring.datasource.initialize=true 10 | spring.datasource.schema=classpath:/schema.sql 11 | spring.datasource.continue-on-error=true 12 | -------------------------------------------------------------------------------- /spring-postgres/backend/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO GREETINGS(name) values ('Docker'); 2 | -------------------------------------------------------------------------------- /spring-postgres/backend/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS GREETINGS ( 2 | id serial PRIMARY KEY, 3 | name varchar(50) NOT NULL 4 | ); 5 | -------------------------------------------------------------------------------- /spring-postgres/backend/src/main/resources/templates/home.ftlh: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Getting Started: Serving Web Content 5 | 6 | 7 | 8 |

Hello from ${name}!

9 | 10 | -------------------------------------------------------------------------------- /spring-postgres/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | backend: 3 | build: backend 4 | ports: 5 | - 8080:8080 6 | environment: 7 | - POSTGRES_DB=example 8 | networks: 9 | - spring-postgres 10 | db: 11 | image: postgres 12 | restart: always 13 | secrets: 14 | - db-password 15 | volumes: 16 | - db-data:/var/lib/postgresql/data 17 | networks: 18 | - spring-postgres 19 | environment: 20 | - POSTGRES_DB=example 21 | - POSTGRES_PASSWORD_FILE=/run/secrets/db-password 22 | expose: 23 | - 5432 24 | volumes: 25 | db-data: 26 | secrets: 27 | db-password: 28 | file: db/password.txt 29 | networks: 30 | spring-postgres: 31 | -------------------------------------------------------------------------------- /spring-postgres/db/password.txt: -------------------------------------------------------------------------------- 1 | db-wrz2z -------------------------------------------------------------------------------- /traefik-golang/.docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | frontend: 3 | image: traefik:2.6 4 | command: --providers.docker --entrypoints.web.address=:80 --providers.docker.exposedbydefault=false 5 | ports: 6 | # The HTTP port 7 | - "80:80" 8 | volumes: 9 | # So that Traefik can listen to the Docker events 10 | - /var/run/docker.sock:/var/run/docker.sock 11 | depends_on: 12 | - backend 13 | backend: 14 | build: 15 | context: backend 16 | target: dev-envs 17 | volumes: 18 | - /var/run/docker.sock:/var/run/docker.sock 19 | labels: 20 | - "traefik.enable=true" 21 | - "traefik.http.routers.go.rule=Path(`/`)" 22 | - "traefik.http.services.go.loadbalancer.server.port=80" 23 | -------------------------------------------------------------------------------- /traefik-golang/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1.4 2 | 3 | FROM --platform=$BUILDPLATFORM golang:1.18 AS build 4 | 5 | WORKDIR /compose/hello-docker 6 | COPY main.go main.go 7 | RUN CGO_ENABLED=0 go build -o backend main.go 8 | 9 | FROM build as dev-envs 10 | 11 | RUN < 1%", 46 | "last 2 versions" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /vuejs/vuejs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/vuejs/vuejs/public/favicon.ico -------------------------------------------------------------------------------- /vuejs/vuejs/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vuejs/vuejs/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 29 | -------------------------------------------------------------------------------- /vuejs/vuejs/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/vuejs/vuejs/src/assets/logo.png -------------------------------------------------------------------------------- /vuejs/vuejs/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App), 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /wireguard/.env: -------------------------------------------------------------------------------- 1 | TIMEZONE=Etc/UTC 2 | VPN_SERVER_URL=your-domain.dyndns.com # free examples http://www.duckdns.org/ and https://www.noip.com/ -------------------------------------------------------------------------------- /wireguard/compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | services: 3 | wireguard: 4 | image: linuxserver/wireguard 5 | container_name: wireguard 6 | cap_add: 7 | - NET_ADMIN 8 | - SYS_MODULE 9 | environment: 10 | - PUID=1000 11 | - PGID=1000 12 | - TZ=${TIMEZONE} 13 | - SERVERURL=${VPN_SERVER_URL} #optional 14 | - SERVERPORT=51820 #optional 15 | - PEERS=1 #optional 16 | - PEERDNS=auto #optional 17 | - INTERNAL_SUBNET=10.13.13.0 #optional 18 | - ALLOWEDIPS=0.0.0.0/0 #optional 19 | volumes: 20 | - /usr/share/appdata/wireguard/config:/config 21 | - /usr/src:/usr/src # location of kernel headers 22 | - /lib/modules:/lib/modules 23 | ports: 24 | - 51820:51820/udp 25 | sysctls: 26 | - net.ipv4.conf.all.src_valid_mark=1 27 | restart: unless-stopped 28 | -------------------------------------------------------------------------------- /wordpress-mysql/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | db: 3 | # We use a mariadb image which supports both amd64 & arm64 architecture 4 | image: mariadb:10.6.4-focal 5 | # If you really want to use MySQL, uncomment the following line 6 | #image: mysql:8.0.27 7 | command: '--default-authentication-plugin=mysql_native_password' 8 | volumes: 9 | - db_data:/var/lib/mysql 10 | restart: always 11 | environment: 12 | - MYSQL_ROOT_PASSWORD=somewordpress 13 | - MYSQL_DATABASE=wordpress 14 | - MYSQL_USER=wordpress 15 | - MYSQL_PASSWORD=wordpress 16 | expose: 17 | - 3306 18 | - 33060 19 | wordpress: 20 | image: wordpress:latest 21 | ports: 22 | - 80:80 23 | restart: always 24 | environment: 25 | - WORDPRESS_DB_HOST=db 26 | - WORDPRESS_DB_USER=wordpress 27 | - WORDPRESS_DB_PASSWORD=wordpress 28 | - WORDPRESS_DB_NAME=wordpress 29 | volumes: 30 | db_data: 31 | 32 | 33 | -------------------------------------------------------------------------------- /wordpress-mysql/output.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajeetraina/awesome-compose/fcb3fe1ee41e5288f979b285e3050c4197eedffc/wordpress-mysql/output.jpg --------------------------------------------------------------------------------