Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docker workflow for local development #1478

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/target
12 changes: 5 additions & 7 deletions deploy-service/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM maven:3.8-openjdk-8-slim AS builder

COPY . /deploy-service

RUN cd /deploy-service && mvn clean package -DskipTests
RUN --mount=type=cache,target=/m2 \
cd /deploy-service && mvn package -DskipTests -Dmaven.repo.local=/m2 -Dassembly.skipAssembly=true

FROM openjdk:8

Expand All @@ -11,10 +12,7 @@ ENV PROJECT_DIR=/opt/deploy-service
RUN mkdir $PROJECT_DIR
WORKDIR $PROJECT_DIR

COPY --from=builder /deploy-service/teletraanservice/target/teletraan-service-0.1-SNAPSHOT-bin.tar.gz $PROJECT_DIR
RUN tar zxf teletraan-service-0.1-SNAPSHOT-bin.tar.gz
COPY ./teletraanservice $PROJECT_DIR/teletraanservice
COPY --from=builder /deploy-service/teletraanservice/target $PROJECT_DIR/teletraanservice
COPY teletraanservice/bin $PROJECT_DIR/teletraanservice/bin

# Default command to run service, do not override it unless for staging run.
# Use "docker logs ID" to view stdout and stderr
CMD ["scripts/run_in_container.sh"]
CMD ["teletraanservice/bin/run.sh", "-c", "teletraanservice/bin/server.yaml"]
6 changes: 0 additions & 6 deletions deploy-service/teletraanservice/Dockerfile

This file was deleted.

2 changes: 2 additions & 0 deletions deploy-service/teletraanservice/bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ function server_start {
com.pinterest.teletraan.TeletraanService \
server ${CONFIG_FILE}"

echo $OPTS

if [ "$1" == "FOREGROUND" ]
then
${JAVA_CMD} ${OPTS}
Expand Down
Loading