mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
63 lines
2.2 KiB
Text
63 lines
2.2 KiB
Text
FROM ubuntu:16.04
|
|
|
|
ARG GIT_REV=unknown
|
|
ARG GIT_BRANCH=unknown
|
|
ARG VERSION=unknown
|
|
ARG VARIANT=unknown
|
|
|
|
# Update and Upgrade
|
|
RUN apt-get update && apt-get upgrade -y
|
|
|
|
# Install dependencies
|
|
RUN apt-get install -y git ca-certificates g++ gcc libc6 libc6-dev pkg-config wget tar lsb-release
|
|
|
|
# Install Go 1.11
|
|
RUN cd /tmp && mkdir golang && cd golang && \
|
|
wget https://dl.google.com/go/go1.11.9.linux-amd64.tar.gz && \
|
|
tar -xvf go1.11.9.linux-amd64.tar.gz && \
|
|
mv go /usr/local && \
|
|
rm -rf /tmp/*
|
|
|
|
ENV GOROOT=/usr/local/go
|
|
ENV PATH=/usr/local/go/bin:${PATH}
|
|
|
|
RUN go version
|
|
|
|
# Add PostgreSQL Repository to Ubuntu
|
|
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
|
|
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" > /etc/apt/sources.list.d/PostgreSQL.list'
|
|
|
|
RUN apt-get update && apt-get install -y postgresql-11
|
|
|
|
# Run the following commands as the ``postgres`` user
|
|
USER postgres
|
|
|
|
RUN /etc/init.d/postgresql start &&\
|
|
psql --command "CREATE USER villasuser WITH SUPERUSER PASSWORD 'villasuser';" && \
|
|
createdb -O villasuser testvillasdb && \
|
|
createdb -O villasuser villasdb
|
|
|
|
# Add ``listen_addresses`` to ``/etc/postgresql/11/main/postgresql.conf``
|
|
RUN echo "listen_addresses='*'" >> /etc/postgresql/11/main/postgresql.conf
|
|
|
|
# Expose the PostgreSQL port
|
|
EXPOSE 5432
|
|
|
|
WORKDIR /villasweb
|
|
ENTRYPOINT bash
|
|
|
|
LABEL \
|
|
org.label-schema.schema-version="1.0" \
|
|
org.label-schema.name="VILLASweb" \
|
|
org.label-schema.license="GPL-3.0" \
|
|
org.label-schema.vcs-ref="$GIT_REV" \
|
|
org.label-schema.vcs-branch="$GIT_BRANCH" \
|
|
org.label-schema.version="$VERSION" \
|
|
org.label-schema.variant="$VARIANT" \
|
|
org.label-schema.vendor="Institute for Automation of Complex Power Systems, RWTH Aachen University" \
|
|
org.label-schema.author.name="Sonja Happ" \
|
|
org.label-schema.author.email="sonja.happ@eonerc.rwth-aachen.de" \
|
|
org.label-schema.description="A image containing all build-time dependencies for VILLASweb-backend-go based on Fedora" \
|
|
org.label-schema.url="http://fein-aachen.org/projects/villas-framework/" \
|
|
org.label-schema.vcs-url="https://git.rwth-aachen.de/VILLASframework/VILLASweb-backend-go"
|
|
|