# Golang Stack

The example below demonstrates a composition of Go, PostgreSQL with the pre-defined Sidecar.

<img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FTkKxwrOLRHJyw3F3awiM%2Fgolang_logo_icon_171074.png?alt=media&#x26;token=0b03c1a6-ce99-4be9-89fa-66604862c699" alt="" data-size="line"><img src="https://3706867246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGo33otNRgIhFn6lpgU%2Fuploads%2FP3wSZyekJOcBmzooIxbY%2Fpostgresql.png?alt=media&#x26;token=f29a86fb-3916-4124-b394-1da5ba071d02" alt="" data-size="line">

{% code title="docker-compose.yml" %}

```docker
version: "3.8"

services:
  web:
    container_name: go-app
    build: ./
    ports:
      - "5000:5000"
    environment:
      DD_DB_HOST: db
    command: /server
    depends_on:
      - db
  db:
    container_name: go-app-db
    image: postgres:14.1-alpine
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: goland
      POSTGRES_PASSWORD: goland
      POSTGRES_DB: goland
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
      
  sidecar:
    image: industryapps.azurecr.io/service-discovery-sidecar
    container_name: { my-apps-name-sidecar }
    restart: always
    environment:
      NODE_ENV: production
      DEPLOYMENT_MODE: public
      EUREKA_INSTANCE_IP: { IP }
      EUREKA_INSTANCE_PORT: { PORT }
      EUREKA_INSTANCE_APP: { app-code }
      EUREKA_INSTANCE_HOST_NAME: { my-app-domain }/
      EUREKA_INSTANCE_HOME_PAGE_URL: https://<your_domain>/{APPCODE}
      EUREKA_HOST: servicediscovery.uat.industryapps.net
      EUREKA_PORT: 443
      
networks:
   default:
      driver: bridge
```

{% endcode %}

Inside the `docker-compose.yml` file, add the necessary information which is tagged with curly braces ' `{  }` '.&#x20;

* **`IP`** -> The IP of the web service which you are running, such as on AWS EC2 Ubuntu, Lightsail instance or Azure Web services as an example.
* **`PORT`** -> The port which the app client-side is served at (e.g. Port 80).
* **`APPCODE`** -> Navigate to Developer dashboard > Applications > {App Name} > App Data, the Application code will be available there.
* **`HOSTNAME`** -> Can be found on the Developer dashboard, the boilerplate is the hostname  of the application: `https://<your_domain>/{APPCODE}`

{% hint style="info" %}
If the application container is pushed onto IndustryApps, the HOSTNAME is the Application ID.
{% endhint %}

[Additional information about Production deployment can be found here.](https://docs.industryapps.net/connect-to-the-platform/production-deployment)
