Skip to content

Commit f122912

Browse files
authored
fix: set correct Dockerfile user workdir defaults (#941)
1 parent 5014ee2 commit f122912

66 files changed

Lines changed: 105 additions & 58 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/tiny-lies-wink.md

Lines changed: 7 additions & 0 deletions

packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ async def main():
1212

1313

1414
if __name__ == "__main__":
15-
asyncio.run(main())
15+
asyncio.run(main())

packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ async def main():
1212

1313

1414
if __name__ == "__main__":
15-
asyncio.run(main())
15+
asyncio.run(main())

packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/template.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
template = (
44
AsyncTemplate()
55
.from_image("python:3.11-slim")
6+
.set_user("root")
7+
.set_workdir("/")
68
.run_cmd("apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*")
79
.set_envs({
810
"PYTHONDONTWRITEBYTECODE": "1",

packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
template,
88
alias="complex-python-app-dev",
99
on_build_logs=default_build_logger(),
10-
)
10+
)

packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_prod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
template,
88
alias="complex-python-app",
99
on_build_logs=default_build_logger(),
10-
)
10+
)

packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/template.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
template = (
44
Template()
55
.from_image("python:3.11-slim")
6+
.set_user("root")
7+
.set_workdir("/")
68
.run_cmd("apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*")
79
.set_envs({
810
"PYTHONDONTWRITEBYTECODE": "1",

packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ async function main() {
88
});
99
}
1010

11-
main().catch(console.error);
11+
main().catch(console.error);

packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ async function main() {
88
});
99
}
1010

11-
main().catch(console.error);
11+
main().catch(console.error);

packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/template.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Template } from 'e2b'
22

33
export const template = Template()
44
.fromImage('python:3.11-slim')
5+
.setUser('root')
6+
.setWorkdir('/')
57
.runCmd('apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*')
68
.setEnvs({
79
'PYTHONDONTWRITEBYTECODE': '1',
@@ -15,4 +17,4 @@ export const template = Template()
1517
.setUser('appuser')
1618
.setUser('root')
1719
.setWorkdir('/home/user')
18-
.setStartCmd('gunicorn --bind 0.0.0.0:8000 app:application', 'sleep 20')
20+
.setStartCmd('gunicorn --bind 0.0.0.0:8000 app:application', 'sleep 20')

0 commit comments

Comments
 (0)