diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6a84d21 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +# Ignore build files +build/ +cmake-build-* + +# Ignore editor-specific files +*.swp +*.log +.idea/ +.vscode/ + +# Ignore version control directories +.git/ +.gitignore \ No newline at end of file diff --git a/dockerfile b/dockerfile index ffc27dd..327ebbc 100644 --- a/dockerfile +++ b/dockerfile @@ -3,12 +3,24 @@ FROM ubuntu:20.04 ENV APPLICATION_BINARY="Application" ENV OPEN_PORT=8080 -COPY ${APPLICATION_BINARY} . - RUN apt-get update && \ ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libboost-all-dev && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + libboost-all-dev \ + git \ + libsqlite3-dev && \ rm -rf /var/lib/apt/lists/* +WORKDIR /app + +COPY . . + +RUN mkdir build && cd build && \ + cmake .. && \ + make + EXPOSE ${OPEN_PORT} -CMD [ "/${APPLICATION_BINARY}" ] \ No newline at end of file + +CMD ["./build/Application"]