-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ec3d97
commit 391c041
Showing
2 changed files
with
23 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
FROM node:slim | ||
FROM golang:latest as builder | ||
WORKDIR /root/ | ||
COPY . . | ||
|
||
# Install NodeJS (https://github.com/nodesource/distributions#installation-instructions) | ||
RUN apt-get update | ||
RUN apt-get install -y ca-certificates curl gnupg build-essential | ||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
|
||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install nodejs | ||
|
||
# Install yarn | ||
RUN npm install -g yarn | ||
|
||
# Build site | ||
RUN cd embedg-site && yarn install && yarn build && cd .. | ||
|
||
# Build app | ||
RUN cd embedg-app && yarn install && yarn build && cd .. | ||
|
||
# Build backend | ||
RUN apt-get update | ||
RUN apt-get install -y build-essential curl | ||
RUN curl -OL https://golang.org/dl/go1.20.4.linux-amd64.tar.gz | ||
RUN tar -C /usr/local -xvf go1.20.4.linux-amd64.tar.gz | ||
ENV PATH=$PATH:/usr/local/go/bin | ||
RUN cd embedg-server && go build --tags "embedapp embedsite" && cd .. | ||
|
||
FROM debian:bullseye-slim | ||
FROM debian:stable-slim | ||
WORKDIR /root/ | ||
COPY --from=0 /root/embedg-server/embedg-server ./ | ||
COPY --from=builder /root/embedg-server/embedg-server . | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y ca-certificates gnupg build-essential | ||
|
||
EXPOSE 8080 | ||
CMD ["./embedg-server"] | ||
CMD ./embedg-server migrate postgres up; ./embedg-server server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters