Docker Community Forums

Share and learn in the Docker community.

How to deploy multiple images docker on aws include postgres image

i have this docker file

FROM elixir:1.7.3-slim as builder

Before running following commands, configure

1. ‘env/local.env’ file.

2. `/apps/snitch_core/config/dev.exs’ file

EXPOSE 4000
EXPOSE 3000

ENV APP_HOME /avia-backend
ENV AWS_ACCESS_KEY_ID dasdas
ENV AWS_SECRET_ACCESS_KEY dasdas
ENV BUCKET_NAME dsadas
ENV AWS_REGION dasda
ENV SENDGRID_API_KEY dassad
ENV PASSWORD_RESET_SALT dsadas
ENV TOKEN_MAXIMUM_AGE sdasda
ENV FRONTEND_CHECKOUT_URL url
ENV HOSTED_PAYMENT_URL url
ENV SUPPORT_URL url
ENV WKHTML_PATH url
ENV ELASTIC_HOST url
ENV DB_HOST url

RUN mkdir $APP_HOME
WORKDIR $APP_HOME

ADD . $APP_HOME

#Install git
RUN apt-get update
&& apt-get install -y git

Install essential packages for application build

RUN apt-get clean
&& apt-get update
&& apt-get install -y apt-utils apt-transport-https curl git make inotify-tools gnupg g++
&& curl -sS url| apt-key add -
&& echo “deb url” | tee /etc/apt/sources.list.d/yarn.list
&& curl -sLurl| bash
&& apt-get install -y nodejs yarn

Umbrella

COPY mix.exs mix.lock ./
COPY config config

Apps

COPY apps apps
RUN mix do local.hex --force, local.rebar --force
RUN mix do deps.get, deps.compile

RUN apt-get clean
&& apt-get update
&& apt-get -y install curl tar file xz-utils build-essential cron
&& apt-get -y install python-certbot-nginx
&& apt-get -y install imagemagick wkhtmltopdf xvfb \

Resolves issue QXcbConnection: Could not connect to display

https://github.com/JazzCore/python-pdfkit/wiki/Using-wkhtmltopdf-without-X-server#debianubuntu

&& printf ‘#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf -q $*’ > /usr/bin/wkhtmltopdf.sh
&& chmod a+x /usr/bin/wkhtmltopdf.sh
&& ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
&& apt-get install -y --no-install-recommends locales \

Supress earlang vm waning form locale issue

&& export LANG=en_US.UTF-8
&& echo $LANG UTF-8 > /etc/locale.gen
&& locale-gen
&& update-locale LANG=$LANG \

Remove unwanted package after use

&& apt-get purge -y curl file xz-utils build-essential locales
&& apt-get -y autoremove
&& apt-get -y clean

RUN cd apps/admin_app/assets
&& yarn install

RUN [“chmod”, “+x”, “./config/docker/dev/docker-dev-provision.sh”]

CMD ["./config/docker/dev/docker-dev-provision.sh"]


and this docker compose

version: ‘3’
services:
webapp:
build:
context: …/…/…/
dockerfile: config/docker/dev/Dockerfile-dev
container_name: aviacommerce-dev
ports:
- “4000:4000”
- “3000:3000”
depends_on:
- db
- elasticsearch
- kibana
links:
- db
- elasticsearch
- kibana
db:
image: postgres:10
container_name: db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=snitchcoco
elasticsearch:
image: url
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- “9200:9200”
kibana:
image: url
ports:
- “5601:5601”
container_name: kibana
pleez help me how to deploy it on aws im a beginner on aws